Go to the source code of this file.
Defines | |
#define | SELECT_TIMEOUT 5 |
#define | LINGER_TIMEOUT 10 |
#define | TRUE 1 |
#define | FALSE 0 |
Functions | |
int | check_connect (char *, int, int) |
Test INET Socket connection to host on port with the specified socket protocol type. More... | |
int | check_host (char *) |
Check if the hostname resolves. More... | |
int | check_connection_io (Port_T) |
Verify that the socket connection is ready for i|o. More... | |
int | check_socket (int) |
Verify that the socket is ready for i|o. More... | |
int | check_udp_socket (int) |
Verify that the udp socket is ready for i|o. More... | |
int | create_socket (char *, int, int) |
Open a socket against hostname:port with the given protocol. More... | |
int | create_generic_socket (Port_T) |
Open a socket with given Port_T structure The protocol, destination and type are selected appropriately. More... | |
int | create_unix_socket (char *, int) |
Open a socket against pathname with the given protocol. More... | |
int | create_server_socket (int, int, char *bindAddr) |
Creates a server socket (SOCK_STREAM type) and binds it to the specified local port number, with the specified backlog. More... | |
int | close_socket (int) |
Shutdown a socket and close the descriptor. More... | |
int | set_sotimeout (int, int) |
Set a so_timeout (read/write) for the given socket with the specified timeout in seconds. More... | |
int | set_noblock (int) |
Enable nonblocking i|o on the given socket. More... | |
int | set_block (int) |
Disable nonblocking i|o on the given socket. More... | |
int | sock_send (int, const char *, int, int) |
Send the message 'msg' down the socket in non-blocking mode and with failover. More... | |
int | sock_recv (int, char *, int, int) |
Read a message from the socket in non-blocking mode and with failover. More... | |
char * | get_localhostname () |
Get the local host name. More... | |
char * | get_remote_host (int) |
Get the remote host name from the originating host. More... |
|
|
|
|
|
Definition at line 28 of file net.h. Referenced by check_socket(), sock_recv(), and sock_send(). |
|
|
|
Test INET Socket connection to host on port with the specified socket protocol type. The protocol is normaly either SOCK_STREAM or SOCK_DGRAM.
Definition at line 102 of file net.c. References check_socket(), close_socket(), and create_socket(). Referenced by check_httpd(). |
|
Verify that the socket connection is ready for i|o. This test use select for a stream based socket. For a dgram sockets the testing technique is to send a 0 byte udp packet and "check" for an ICMP error.
Definition at line 152 of file net.c. References check_socket(), check_udp_socket(), myport::socket, and myport::type. |
|
Check if the hostname resolves.
|
|
Verify that the socket is ready for i|o.
Definition at line 170 of file net.c. References SELECT_TIMEOUT. Referenced by check_connect(), check_connection_io(), and start_httpd(). |
|
Verify that the udp socket is ready for i|o. The given socket must be a connected udp socket.
Definition at line 192 of file net.c. References set_block(), and set_noblock(). Referenced by check_connection_io(). |
|
Shutdown a socket and close the descriptor.
Definition at line 385 of file net.c. Referenced by check_connect(), create_socket(), create_unix_socket(), destroy_wrapper(), dstart_process(), dstop_process(), and stop_httpd(). |
|
Open a socket with given Port_T structure The protocol, destination and type are selected appropriately.
Definition at line 266 of file net.c. References create_socket(), create_unix_socket(), myport::family, myport::hostname, myport::pathname, myport::port, and myport::type. |
|
Creates a server socket (SOCK_STREAM type) and binds it to the specified local port number, with the specified backlog. Set a socket option to make the port reusable again. This is useful if the server has been shut down, and then restarted right away while sockets are still active on its port. If a bind address is given the socket will only accept connect requests to this addresses. If the bind address is NULL it will default accepting connections on any/all local addresses
Definition at line 332 of file net.c. Referenced by start_httpd(). |
|
Open a socket against hostname:port with the given protocol. The protocol is normaly either SOCK_STREAM or SOCK_DGRAM.
Definition at line 226 of file net.c. References close_socket(). Referenced by check_connect(), create_generic_socket(), dstart_process(), and dstop_process(). |
|
Open a socket against pathname with the given protocol. The protocol is normaly either SOCK_STREAM or SOCK_DGRAM.
Definition at line 292 of file net.c. References close_socket(). Referenced by create_generic_socket(). |
|
Get the local host name.
Definition at line 575 of file net.c. Referenced by sendmail(). |
|
Get the remote host name from the originating host.
|
|
Disable nonblocking i|o on the given socket.
Definition at line 442 of file net.c. Referenced by check_udp_socket(), sock_recv(), and sock_send(). |
|
Enable nonblocking i|o on the given socket.
Definition at line 428 of file net.c. Referenced by check_udp_socket(), sock_recv(), and sock_send(). |
|
Set a so_timeout (read/write) for the given socket with the specified timeout in seconds.
|
|
Read a message from the socket in non-blocking mode and with failover. Inspired by code from the Apache web server.
Definition at line 526 of file net.c. References len, SELECT_TIMEOUT, set_block(), and set_noblock(). Referenced by check_ftp(), check_http(), check_imap(), check_nntp(), check_pop(), and check_smtp(). |
|
Send the message 'msg' down the socket in non-blocking mode and with failover. Inspired by code from the Apache web server.
Definition at line 460 of file net.c. References len, SELECT_TIMEOUT, set_block(), and set_noblock(). Referenced by check_ftp(), check_http(), check_imap(), check_nntp(), check_pop(), check_smtp(), dstart_process(), and dstop_process(). |