Communication over the TCP protocol (reliable streaming). More...
Modules | |
| Low level TCP Connections | |
| Low level functions to access TCP. | |
Data Structures | |
| struct | tcp_server_config_t |
| TCP Server configuration options. More... | |
Macros | |
| #define | tcp_server_config() |
| Default TCP server configuration. | |
Typedefs | |
| typedef void() | nodec_tcp_connection_fun_t(int id, nodec_bstream_t *client, lh_value arg) |
| The server callback when listening on a TCP connection. More... | |
Functions | |
| nodec_bstream_t * | async_tcp_connect_at (const struct sockaddr *addr, const char *host) |
| Establish a TCP connection. More... | |
| nodec_bstream_t * | async_tcp_connect_at_host (const char *host, const char *service) |
| Establish a TCP connection. More... | |
| nodec_bstream_t * | async_tcp_connect (const char *host) |
| Establish a TCP connection. More... | |
| void | async_tcp_server_at (const struct sockaddr *addr, tcp_server_config_t *config, nodec_tcp_connection_fun_t *servefun, lh_actionfun *on_exn, lh_value arg) |
| Create a TCP server. More... | |
Communication over the TCP protocol (reliable streaming).
| struct tcp_server_config_t |
TCP Server configuration options.
| typedef void() nodec_tcp_connection_fun_t(int id, nodec_bstream_t *client, lh_value arg) |
The server callback when listening on a TCP connection.
| id | The identity of the current asynchronous strand. |
| client | The connecting client data stream. |
| arg | The lh_value passed from async_tcp_server_at(). |
| nodec_bstream_t* async_tcp_connect | ( | const char * | host | ) |
Establish a TCP connection.
| host | Host address as a url, like "http://www.bing.com". |
| nodec_bstream_t* async_tcp_connect_at | ( | const struct sockaddr * | addr, |
| const char * | host | ||
| ) |
Establish a TCP connection.
| addr | Connection address. |
| host | Host name, only used for error messages and can be NULL. |
| nodec_bstream_t* async_tcp_connect_at_host | ( | const char * | host, |
| const char * | service | ||
| ) |
Establish a TCP connection.
| host | Host address. |
| service | Can be a port ("8080") or service ("https"). Uses "http" when NULL. |
| void async_tcp_server_at | ( | const struct sockaddr * | addr, |
| tcp_server_config_t * | config, | ||
| nodec_tcp_connection_fun_t * | servefun, | ||
| lh_actionfun * | on_exn, | ||
| lh_value | arg | ||
| ) |
Create a TCP server.
| addr | The socket address to serve. |
| config | The TCP server configuration, can be NULL in which case tcp_server_config() is used. |
| servefun | The callback called when a client connects. |
| on_exn | Optional function that is called when an exception happens in servefun. |
| arg | Optional argument to pass on to servefun, can be lh_value_null. |