Next: mod-httpd, Previous: mod-ogg, Up: C API

### 5.36 libsrv

#### 5.36.1 Overview

View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/srv/index.html.

#### 5.36.2 API

— Function: lw6srv_oob_t * lw6srv_oob_new (char * remote_ip, int remote_port, int sock, char * first_line)

> remote_ip: remote IP address

> remote_port: remote port

> sock: the socket handler (either TCP or UDP)

> first_line: the first line of data (can be NULL)

> Create a new OOB structure, copying required objects. We need to make copies for this is for usage in a separate thread. The thread member is not set here since the right way to do things is first to set up data then to fire the thread.

> Return value: new object

— Function: void lw6srv_oob_free (lw6srv_oob_t * oob)

> oob: the object to free

> Frees an OOB structure.

> Return value: none

— Function: lw6srv_tcp_accepter_t * lw6srv_tcp_accepter_new (char * client_ip, int client_port, int sock)

> client_ip: the client ip, will be freed when accepter is freed, do not copy it

> client_port: the client port

> sock: the socket used

> Creates a tcp_accepter object.

> Return value: none

— Function: void lw6srv_tcp_accepter_free (lw6srv_tcp_accepter_t * tcp_accepter)

> tcp_accepter: the object to free

> Frees a tcp_accepter object.

> Return value: none

— Function: int lw6srv_test (int mode)

> mode: 0 for check only, 1 for full test

> Runs the `srv` module test suite.

> Return value: 1 if test is successfull, 0 on error.

— Function: lw6srv_udp_buffer_t * lw6srv_udp_buffer_new (char * client_ip, int client_port, char * line)

> client_ip: the client ip, will be freed when object is freed, do not free it

> client_port: the client port

> line: the line received, will be freed when object is freed, do not free it

> Creates an udp_buffer object.

> Return value: none

— Function: void lw6srv_udp_buffer_free (lw6srv_udp_buffer_t * udp_buffer)

> udp_buffer: the object to free

> Frees a udp_buffer object.

> Return value: none