Next: , Previous: , Up: Server functions   [Contents][Index]


5.2.12.3 Bindings

The following functionality represents the relationship between port configurations as described in Port configurations and server instances. When binding a server to a specific port configuration the core library creates listeners as needed by itself.

Function: int svz_server_bind (svz_server_t *server, svz_portcfg_t *port)

Bind the server instance server to the port configuration port if possible. Return non-zero on errors, otherwise zero. It might occur that a single server is bound to more than one network port if, e.g., the TCP/IP address is specified by ‘*’ (asterisk) since this gets expanded to the known list of interfaces.

Function: svz_array_t * svz_server_portcfgs (svz_server_t *server)

Return an array of port configurations to which the server instance server is currently bound to, or NULL if there is no such binding. Caller should svz_array_destroy the returned array when done.

Function: svz_array_t * svz_server_listeners (svz_server_t *server)

Return an array of listening socket structures to which the server instance server is currently bound to, or NULL if there is no such binding. Caller should svz_array_destroy the returned array when done.

Function: svz_array_t * svz_sock_servers (svz_socket_t *sock)

Return the array of server instances bound to the listening sock, or NULL if there are no bindings. Caller should svz_array_destroy the returned array when done.

Function: int svz_binding_contains_server (svz_socket_t *sock, svz_server_t *server)

Checks whether the server instance server is bound to the server socket structure sock. Return one if so, otherwise zero.

Function: size_t svz_pp_server_bindings (char *buf, size_t size, svz_server_t *server)

Format a space-separated list of current port configuration bindings for server into buf, which has size bytes. The string is guaranteed to be nul-terminated. Return the length (at most size - 1) of the formatted string.


Next: Server core, Previous: Configuration, Up: Server functions   [Contents][Index]