Void serverLoop(Protocol proto, Int port, Int maxcon, Void(NetHandle) commfun, Void(NetHandle, Int) forkfun=forkfunDefault)
Arguments
proto: The protocol (Net::Protocol) to listen onport: The port to listen onmaxcon: The maximum number of simultaneous connections to accept.commfun: The function that processes each new connection. The connection will be closed automatically when this function exits, so it need not.forkfun: This function is run by the old process after the new process is forked, and is given the process ID of the new process. This argument may be omitted, in which case a default function that does nothing will be used.
Usage
This function provides a basic implementation of a forking server loop, similar in architecture to sshd.