This section describes the internal coserver interface of Serveez. Coservers are helper processes meant to perform blocking tasks. This is necessary because Serveez itself is single threaded. Each coserver is connected via a pair of pipes to the main thread of Serveez communicating over a simple text line protocol. Each request/response is separated by a newline character.
Call func for each coserver, 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.
Under woe32 check if there was any response from an active coserver. Moreover keep the coserver threads/processes alive. If one of the coservers dies due to buffer overrun or might be overloaded, start a new one.
Call this function whenever there is time, e.g., within the timeout of the
select system call.
Destroy specific coservers with the type type. All instances of this coserver type will be stopped.
Create and return a single coserver with the given type type.
Return the type name of coserver.
Enqueue a request for the reverse DNS coserver to resolve address addr, arranging for callback cb to be called with two args: the hostname (a string) and the opaque data closure.
Enqueue a request for the DNS coserver to resolve host, arranging for callback cb to be called with two args: the ip address in dots-and-numbers notation and the opaque data closure.
Enqueue a request for the ident coserver to resolve the client identity at sock, arranging for callback cb to be called with two args: the identity (string) and the opaque data closure.
To make use of coservers, you need to start the coserver interface by
svz_updn_all_coservers once before, and once after,
entering the main server loop.
If direction is non-zero, init coserver internals. Otherwise, finalize them. Return 0 if successful.
If direction is positive, init also starts one instance each of the builtin servers. If negative, it doesn’t.