.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "ServerLoop.serverLoop" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" ServerLoop::serverLoop \- A basic implementation of a server loop. .SH "SYNOPSIS" .B Void serverLoop( \fIProtocol proto, Int port, Int maxcon, Void(NetHandle) commfun, Void(NetHandle, Int) forkfun=forkfunDefault\fP .B ")" .SH "ARGUMENTS" .PP .B "proto" The protocol ( .B "Net.Protocol"(3kaya) ) to listen on .PP .B "port" The port to listen on .PP .B "maxcon" The maximum number of simultaneous connections to accept. .PP .B "commfun" The function that processes each new connection. The connection will be closed automatically when this function exits, so it need not. .PP .B "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. .SH "DESCRIPTION" .PP This function provides a basic implementation of a forking server loop, similar in architecture to sshd. .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE 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.