11 namespace rp{
namespace net {
18 ADDRESS_TYPE_UNSPEC = 0,
19 ADDRESS_TYPE_INET = 1,
20 ADDRESS_TYPE_INET6 = 2,
41 virtual u_result getAddressAsString(
char * buffer,
size_t buffersize)
const;
45 virtual u_result getRawAddress(
_u8 * buffer,
size_t bufferSize)
const;
48 return _platform_data;
51 virtual void setLoopbackAddress(
address_type_t = ADDRESS_TYPE_INET);
52 virtual void setBroadcastAddressIPv4();
56 static size_t LoopUpHostName(
const char * hostname,
const char * sevicename, std::vector<SocketAddress> &addresspool ,
bool performDNS =
true,
address_type_t = ADDRESS_TYPE_INET);
68 SOCKET_FAMILY_INET = 0,
69 SOCKET_FAMILY_INET6 = 1,
70 SOCKET_FAMILY_RAW = 2,
77 SOCKET_DIR_BOTH = (SOCKET_DIR_RD | SOCKET_DIR_WR),
81 DEFAULT_SOCKET_TIMEOUT = 10000,
85 virtual void dispose() = 0;
91 virtual u_result waitforSent(
_u32 timeout = DEFAULT_SOCKET_TIMEOUT) = 0;
92 virtual u_result waitforData(
_u32 timeout = DEFAULT_SOCKET_TIMEOUT) = 0;
110 virtual u_result listen(
int backlog = MAX_BACKLOG) = 0;
112 virtual u_result waitforIncomingConnection(
_u32 timeout = DEFAULT_SOCKET_TIMEOUT) = 0;
114 virtual u_result send(
const void * buffer,
size_t len) = 0;
116 virtual u_result recv(
void *buf,
size_t len,
size_t & recv_len) = 0;
122 virtual u_result enableKeepAlive(
bool enable =
true) = 0;
124 virtual u_result enableNoDelay(
bool enable =
true) = 0;
142 virtual u_result recvFrom(
void *buf,
size_t len,
size_t & recv_len,
SocketAddress * sourceAddr = NULL) = 0;
ROSCPP_DECL uint32_t getPort()
const void * getPlatformData() const
ROSCONSOLE_DECL void shutdown()