18 #ifndef SOCKET_CLIENT_HPP
19 #define SOCKET_CLIENT_HPP
26 struct sockaddr_in m_servaddr;
27 unsigned int m_connect_timeout_millisec;
28 unsigned short m_port;
35 void set_port(
unsigned short port) {
37 m_servaddr.sin_port = htons(m_port);
39 void set_connect_timeout(
unsigned int timeout_millisec) {
40 m_connect_timeout_millisec = timeout_millisec;
42 unsigned short get_port() {
return m_port; };
43 char *get_server_name() {
return m_server_name; };
44 int bind(
const char* toaddress,
unsigned short toport);
45 NDB_SOCKET_TYPE connect(
const char* toaddress = 0,
unsigned short port = 0);
48 NDB_SOCKET_TYPE m_sockfd;
51 #endif // SOCKET_ClIENT_HPP