7 #include <netinet/in.h>
8 #include <sys/socket.h>
16 namespace remote
{ namespace protocols
{
20 int openServerSocket(struct sockaddr_in
& server
, unsigned int port
, int max_pending
, int retryInterval
);
21 int openClientSocket(std::string address
, unsigned int port
);
22 int nextClient( int serversock
, sockaddr_in
& client
);
24 void setSendTimeout(int fd
, long seconds
, long microseconds
);
25 void setKeepAlive( int fd
, int numProbes
, int idleTime
, int interval
);
26 void setSendBuffer( int fd
, int byteSize
);
28 in_addr_t
resolve(const char *ip_addr
);
29 char* getHostByIp(in_addr ip
);
31 template<class T
> bool recv(int fd
, T
& value
);
32 template<class T
> bool send(int fd
, T value
);
34 template<class T
> uint8_t* readvalue(T
& value
,uint8_t* buffer
, uint32_t& buflen
);
35 template<class T
> uint8_t* writevalue(T value
,uint8_t* buffer
, uint32_t& buflen
);