ServerLoop::serverLoop(3) A basic implementation of a server loop.


Void serverLoop( Protocol proto, Int port, Int maxcon, Void(NetHandle) commfun, Void(NetHandle, Int) forkfun=forkfunDefault )


proto The protocol ( Net.Protocol(3kaya) ) to listen on

port The port to listen on

maxcon 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.


This function provides a basic implementation of a forking server loop, similar in architecture to sshd.


Kaya standard library by Edwin Brady, Chris Morris and others ([email protected]). For further information see


The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation.