Options for server creation:
backlog
is the number of clients that can have a connection pending, as with Unix.listen
. Additional connections may be rejected, ignored, or enqueued anyway, depending on OS, version, and configuration.
max_connections
is the maximum number of clients that can be connected simultaneously. The server will not call accept
unless the number of clients is less than max_connections
, although of course potential clients can have a connection pending.
max_accepts_per_batch
is the maximum number of connections that the server will retrieve per blocking Unix.accept
call. Servers that must handle a large number of connections tend to observe a stall in connection accept rates when under heavy load. Increasing max_accepts_per_batch
will ameliorate this effect, increasing connection accept rates and overall throughput at the cost of increased contention for resources amongst connections. Servers that are under light load or ones that only service a small number of connections at a time should see little to no difference in behavior for different values of max_accepts_per_branch
.
Supplying socket
causes the server to use socket
rather than create a new socket. In this usage, creation does not set Socket.Opt.reuseaddr
to true
; if you want that, you must set reuseaddr
before creation.
on_handler_error
determines what happens if the handler throws an exception. If an exception is raised by on_handler_error (either explicitly via `Raise
, or in the closure passed to `Call
) no further connections will be accepted.