Provides convenience functions for establishing low-level TCP connections. More...
Go to the source code of this file.
Functions | |
int | guac_tcp_connect (const char *hostname, const char *port, const int timeout) |
Given a hostname or IP address and port, attempt to connect to that system, returning the file descriptor of an open socket if the connection succeeds, or a negative value if it fails. | |
Provides convenience functions for establishing low-level TCP connections.
int guac_tcp_connect | ( | const char * | hostname, |
const char * | port, | ||
const int | timeout ) |
Given a hostname or IP address and port, attempt to connect to that system, returning the file descriptor of an open socket if the connection succeeds, or a negative value if it fails.
The returned file descriptor must eventually be freed with a call to close(). If this function fails, guac_error will be set appropriately.
hostname | The hostname or IP address to which to attempt connections. |
port | The TCP port to which to attempt to connect. |
timeout | The number of seconds to try the TCP connection before timing out. |