25 : ByteStreamDriverModelComponentBase(compName),
29 ByteStreamDriverModelComponentBase::init(instance);
34 const U32 send_timeout_seconds,
35 const U32 send_timeout_microseconds) {
36 return m_socket.
configure(hostname, port, send_timeout_seconds, send_timeout_microseconds);
50 return allocate_out(0, 1024);
54 Drv::RecvStatus recvStatus = (status ==
SOCK_SUCCESS) ? RecvStatus::RECV_OK : RecvStatus::RECV_ERROR;
55 this->recv_out(0, buffer, recvStatus);
59 if (isConnected_ready_OutputPort(0)) {
73 return SendStatus::SEND_RETRY;
75 deallocate_out(0, fwBuffer);
76 return SendStatus::SEND_ERROR;
78 deallocate_out(0, fwBuffer);
79 return SendStatus::SEND_OK;
84 return PollStatus::POLL_ERROR;
PlatformIntType NATIVE_INT_TYPE
C++-compatible configuration header for fprime configuration.
Helper base-class for setting up Berkley sockets.
SocketIpStatus send(const U8 *const data, const U32 size)
send data out the IP socket from the given buffer
SocketIpStatus configure(const char *hostname, const U16 port, const U32 send_timeout_seconds, const U32 send_timeout_microseconds)
configure the ip socket with host and transmission timeouts
supports a task to read a given socket adaptation
TcpClientComponentImpl(const char *const compName)
construct the TcpClient component.
void connected()
called when the IPv4 system has been connected
void sendBuffer(Fw::Buffer buffer, SocketIpStatus status)
sends a buffer to be filled with data
IpSocket & getSocketHandler()
returns a reference to the socket handler
Fw::Buffer getBuffer()
returns a buffer to fill with data
~TcpClientComponentImpl()
Destroy the component.
void init(const NATIVE_INT_TYPE instance=0)
Initialize this component.
SocketIpStatus configure(const char *hostname, const U16 port, const U32 send_timeout_seconds=SOCKET_SEND_TIMEOUT_SECONDS, const U32 send_timeout_microseconds=SOCKET_SEND_TIMEOUT_MICROSECONDS)
Configures the TcpClient settings but does not open the connection.
SocketIpStatus
Status enumeration for socket return values.
@ SOCK_SUCCESS
Socket operation successful.
@ SOCK_INTERRUPTED_TRY_AGAIN
Interrupted status for retries.