|
Data Structures |
| struct | _four_bytes |
| | These structures are used for represent ip address as bytes. More...
|
| struct | _sockets_env |
| union | ip_to_bytes |
Defines |
| #define | MAX_EMPTY_READINGS 4 |
| #define | MAX_PENDING_CONNECTIONS 44 |
Typedefs |
| typedef _four_bytes | four_bytes |
| | These structures are used for represent ip address as bytes.
|
| typedef in_addr | hip |
| typedef unsigned short | hport |
| typedef sockaddr_in | hsockaddr |
| typedef int | hsocket |
| typedef _sockets_env | sockets_env |
Functions |
| int | _str_to_ip (const char *buffer, hip *pip) |
| | Coverts string to ip address.
|
| hsocket | accept_socket (hsocket server_socket, hsockaddr *peer_address) |
| | Simple wrapper for accept function.
|
| int | bind_socket (hsocket sock, struct in_addr ip, hport port) |
| int | cleanup_socket_subsystem () |
| | Cleans up socket subsistem.
|
| void | close_socket (hsocket sock) |
| | Closes socket.
|
| int | common_recv (hsocket sk, char *buf, unsigned int buflen, unsigned int *received) |
| int | common_send (hsocket sk, const char *buf, unsigned int buflen, unsigned int *sent) |
| | Send buffer.
|
| int | connect_socket (hsocket sock, const hsockaddr *paddr) |
| | Blocking connect.
|
| int | create_listening_socket (hsocket *phsocket, struct in_addr server_address, hport server_port) |
| | Creates socket for server.
|
| int | init_socket_subsystem () |
| | Initializes socket subsistem.
|
| int | ip_to_str (hip ip, char *buffer) |
| | Convers ip address to string.
|
| int | listen_socket (hsocket sock) |
| hsocket | new_tcp_socket () |
| int | nonblocking_accept (hsocket server_socket, unsigned int ms_to_wait, hsocket *new_socket, hsockaddr *peer_address) |
| | Accepts incoming connection like classic "accept" but returns through "ms_to_wait" microseconds, i.e.
|
| int | nonblocking_recv (hsocket sk, unsigned int ms_to_wait, char *buf, unsigned int buflen, unsigned int *received) |
| | Receives incoming data like classic "recv" but returns through "ms_to_wait" microseconds, i.e.
|
| int | nonblocking_send (hsocket sk, unsigned int ms_to_wait, const char *buf, unsigned int buflen, unsigned int *sent) |
| | Sends data like classic "send" but returns through "ms_to_wait" microseconds, i.e.
|
| int | receive_socket (hsocket sock, char *recvbuff, unsigned int bufflen) |
| | Simple wrapper for recv function.
|
| int | send_socket (hsocket sock, const char *buff, unsigned int len) |
| | Simple wrapper for send function.
|
Variables |
| sockets_env | sockets_os_enviroment |
Set it at the first place before any inclusion of <windows.h>.