qLibc
|
Socket dandling APIs. More...
Go to the source code of this file.
Functions | |
int | qsocket_open (const char *hostname, int port, int timeoutms) |
Create a TCP socket for the remote host and port. More... | |
bool | qsocket_close (int sockfd, int timeoutms) |
Close socket. More... | |
bool | qsocket_get_addr (struct sockaddr_in *addr, const char *hostname, int port) |
Convert hostname to sockaddr_in structure. More... | |
char * | qsocket_get_localaddr (char *buf, size_t bufsize) |
Return local IP address. More... | |
Socket dandling APIs.
Definition in file qsocket.c.
int qsocket_open | ( | const char * | hostname, |
int | port, | ||
int | timeoutms | ||
) |
Create a TCP socket for the remote host and port.
hostname | remote hostname |
port | remote port |
timeoutms | wait timeout milliseconds. if set to negative value, wait indefinitely. |
bool qsocket_close | ( | int | sockfd, |
int | timeoutms | ||
) |
bool qsocket_get_addr | ( | struct sockaddr_in * | addr, |
const char * | hostname, | ||
int | port | ||
) |