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

Variable: svz_t_handle svz_child_died

Set to a non-zero value whenever the server receives a SIGCHLD signal.

Function: int svz_shutting_down_p (void)

Return non-zero if the core is in the process of shutting down (typically as a result of a signal).

Function: int svz_foreach_socket (svz_socket_do_t *func, void *closure)

Call func for each socket, passing additionally the second arg closure. If func returns a negative value, return immediately with that value (breaking out of the loop), otherwise, return 0.

Function: svz_socket_t * svz_sock_find (int id, int version)

Return the socket structure for the socket id id and the version version, or NULL if no such socket exists. If version is -1 it is not checked.

Function: int svz_sock_schedule_for_shutdown (svz_socket_t *sock)

Mark socket sock as killed. That means that no further operations except disconnecting and freeing are allowed. All marked sockets will be deleted once the server loop is through.

Function: int svz_sock_enqueue (svz_socket_t *sock)

Enqueue the socket sock into the list of sockets handled by the server loop.

Function: void svz_sock_setparent (svz_socket_t *child, svz_socket_t *parent)

Set the child socket’s parent to parent.

This should be called whenever a listener accepts a connection and creates a new child socket.

Function: svz_socket_t * svz_sock_getparent (svz_socket_t *child)

Return the child socket’s parent socket structure, or NULL if this socket does not exist anymore. This might happen if a listener dies for some reason.

Function: void svz_sock_setreferrer (svz_socket_t *sock, svz_socket_t *referrer)

Set the referring socket structure of sock to referrer. If referrer is NULL the reference will be invalidated.

This can be used to create some relationship between two socket structures.

Function: svz_socket_t * svz_sock_getreferrer (svz_socket_t *sock)

Get the referrer of the socket structure sock. Return NULL if there is no such socket.

Function: svz_portcfg_t * svz_sock_portcfg (svz_socket_t *sock)

Return the parent’s port configuration of sock, or NULL if the given socket has no parent, i.e. is a listener.

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