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);
154 struct sockaddr_in m_addr_send;
155 struct sockaddr_in m_addr_recv;
156 bool m_recv_configured;
SocketIpStatus send(const SocketDescriptor &socketDescriptor, const U8 *const data, const U32 size) override
UDP-specific implementation of send that handles zero-length datagrams correctly. ...
U16 getRecvPort()
get the port being received on
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.
I32 sendProtocol(const SocketDescriptor &socketDescriptor, const U8 *const data, const U32 size) override
Protocol specific implementation of send. Called directly with retry from send.
I32 recvProtocol(const SocketDescriptor &socketDescriptor, U8 *const data, const U32 size) override
Protocol specific implementation of recv. Called directly with error handling from recv...
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 ...
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.