53 |
* @param protocol The socket protocol to use |
* @param protocol The socket protocol to use |
54 |
* @return TRUE if the connect succeeded otherwise FALSE. |
* @return TRUE if the connect succeeded otherwise FALSE. |
55 |
*/ |
*/ |
56 |
int check_connect(char *hostname, int port, int protocol); |
int check_connect(const char *hostname, int port, int protocol); |
57 |
|
|
58 |
|
|
59 |
/** |
/** |
61 |
* @param hostname The host to check |
* @param hostname The host to check |
62 |
* @return TRUE if hostname resolves, otherwise FALSE |
* @return TRUE if hostname resolves, otherwise FALSE |
63 |
*/ |
*/ |
64 |
int check_host(char *hostname); |
int check_host(const char *hostname); |
65 |
|
|
66 |
|
|
67 |
/** |
/** |
96 |
* @param timeout If not connected within timeout seconds abort and return -1 |
* @param timeout If not connected within timeout seconds abort and return -1 |
97 |
* @return The socket or -1 if an error occured. |
* @return The socket or -1 if an error occured. |
98 |
*/ |
*/ |
99 |
int create_socket(char *hostname, int port, int protocol, int timeout); |
int create_socket(const char *hostname, int port, int protocol, int timeout); |
100 |
|
|
101 |
|
|
102 |
/** |
/** |
114 |
* @param timeout If not connected within timeout seconds abort and return -1 |
* @param timeout If not connected within timeout seconds abort and return -1 |
115 |
* @return The socket or -1 if an error occured. |
* @return The socket or -1 if an error occured. |
116 |
*/ |
*/ |
117 |
int create_unix_socket(char *pathname, int timeout); |
int create_unix_socket(const char *pathname, int timeout); |
118 |
|
|
119 |
|
|
120 |
/** |
/** |
129 |
* @param bindAddr the local address the server will bind to |
* @param bindAddr the local address the server will bind to |
130 |
* @return The socket ready for accept, or -1 if an error occured. |
* @return The socket ready for accept, or -1 if an error occured. |
131 |
*/ |
*/ |
132 |
int create_server_socket(int port, int backlog, char *bindAddr); |
int create_server_socket(int port, int backlog, const char *bindAddr); |
133 |
|
|
134 |
|
|
135 |
/** |
/** |
184 |
* @param size Number of bytes to send |
* @param size Number of bytes to send |
185 |
* @return The number of bytes sent or -1 if an error occured. |
* @return The number of bytes sent or -1 if an error occured. |
186 |
*/ |
*/ |
187 |
int sock_write(int socket, void *buffer, int size); |
int sock_write(int socket, const void *buffer, int size); |
188 |
|
|
189 |
|
|
190 |
/** |
/** |