![]() |
Functions | |
int | qSocketOpen (const char *hostname, int port, int timeoutms) |
Create a TCP socket for the remote host and port. | |
bool | qSocketClose (int sockfd, int timeoutms) |
Close socket. | |
bool | qSocketGetAddr (struct sockaddr_in *addr, const char *hostname, int port) |
Convert hostname to sockaddr_in structure. |
int qSocketOpen | ( | 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 qSocketClose | ( | int | sockfd, | |
int | timeoutms | |||
) |
Close socket.
sockfd | socket descriptor | |
timeoutms | if timeoutms >= 0, shut down write connection first then wait and throw out input stream data. set to -1 to close socket immediately. |
bool qSocketGetAddr | ( | struct sockaddr_in * | addr, | |
const char * | hostname, | |||
int | port | |||
) |
Convert hostname to sockaddr_in structure.
addr | sockaddr_in structure pointer | |
hostname | IP string address or hostname | |
port | port number |