12 #ifndef DRV_IP_UDPSOCKET_HPP_ 13 #define DRV_IP_UDPSOCKET_HPP_ 17 #include <config/IpCfg.hpp> 20 #ifdef TGT_OS_TYPE_VXWORKS 24 #include <arpa/inet.h> 25 #include <sys/socket.h> 54 const U32 send_timeout_seconds,
55 const U32 send_timeout_microseconds)
override;
77 const U32 send_timeout_seconds,
78 const U32 send_timeout_microseconds);
135 const U8*
const data,
158 struct sockaddr_in m_addr_send;
159 struct sockaddr_in m_addr_recv;
160 bool m_recv_configured;
U16 getRecvPort()
get the port being received on
SocketIpStatus send(const SocketDescriptor &socketDescriptor, const U8 *const data, const FwSizeType size) override
UDP-specific implementation of send that handles zero-length datagrams correctly. ...
PlatformSizeType FwSizeType
FwSignedSizeType sendProtocol(const SocketDescriptor &socketDescriptor, const U8 *const data, const FwSizeType size) override
Protocol specific implementation of send. Called directly with retry from send.
PlatformSignedSizeType FwSignedSizeType
SocketIpStatus configureRecv(const char *hostname, const U16 port)
configure the udp socket for incoming transmissions
virtual ~UdpSocket()
to cleanup state created at instantiation
Helper for setting up Udp using Berkeley sockets as a client.
UdpSocket()
Constructor for client socket udp implementation.
SocketIpStatus bind(const int fd)
bind the UDP to a port such that it can receive packets at the previously configured port ...
FwSignedSizeType recvProtocol(const SocketDescriptor &socketDescriptor, U8 *const data, const FwSizeType size) override
Protocol specific implementation of recv. Called directly with error handling from recv...
SocketIpStatus configureSend(const char *hostname, const U16 port, const U32 send_timeout_seconds, const U32 send_timeout_microseconds)
configure the udp socket for outgoing transmissions
uint8_t U8
8-bit unsigned integer
SocketIpStatus
Status enumeration for socket return values.
Helper base-class for setting up Berkeley sockets.
SocketIpStatus handleZeroReturn() override
Handle zero return from recvProtocol for UDP.
SocketIpStatus configure(const char *hostname, const U16 port, const U32 send_timeout_seconds, const U32 send_timeout_microseconds) override
configure is disabled
SocketIpStatus openProtocol(SocketDescriptor &socketDescriptor) override
udp specific implementation for opening a socket.