The functions described in this section deal with the
operations on C structures called
svz_socket_t. See the description of each function for details
on which kind of socket it can handle and what they are for.
Return the number of currently connected sockets.
Write len bytes from the memory location pointed to by buf to the output buffer of the socket sock. Also try to flush the buffer to the socket of sock if possible. Return a non-zero value on error, which normally means a buffer overflow.
Print a formatted string on the socket sock. fmt is the
printf-style format string, which describes how to format the
Resize the send and receive buffers for the socket sock. send_buf_size is the new size for the send buffer, recv_buf_size for the receive buffer. Note that data may be lost when the buffers shrink. For a new buffer size of 0 the buffer is freed and the pointer set to NULL.
Check for the kind of packet delimiter within sock and
and assign one of the default
(one or more byte delimiters or a fixed size).
Afterwards this function will never ever be called again because the callback gets overwritten here.
Shorten the receive buffer of sock by len bytes.
Reduce the send buffer of sock by len bytes.
Because libserveez manages the creation and destruction of
svz_socket_t objects internally, the following API element
is useful for syncronizing client-code references to those objects
with those objects.
Register (if addsub is non-zero), or unregister (otherwise)
the function fn to be called immediately
prior to a
svz_socket_t being freed.
fn is called with one arg
and should not return anything. In other words:
typedef void (svz_sock_prefree_fn) (const svz_socket_t *);