1ServerLoop.serverLoop(3kaya) Kaya module referenceServerLoop.serverLoop(3kaya)
2
3
4
6 ServerLoop::serverLoop - A basic implementation of a server loop.
7
9 Void serverLoop( Protocol proto, Int port, Int maxcon, Void(NetHandle)
10 commfun, Void(NetHandle, Int) forkfun=forkfunDefault )
11
13 proto The protocol ( Net.Protocol (3kaya) ) to listen on
14
15 port The port to listen on
16
17 maxcon The maximum number of simultaneous connections to accept.
18
19 commfun The function that processes each new connection. The connection
20 will be closed automatically when this function exits, so it need not.
21
22 forkfun This function is run by the old process after the new process
23 is forked, and is given the process ID of the new process. This argu‐
24 ment may be omitted, in which case a default function that does nothing
25 will be used.
26
28 This function provides a basic implementation of a forking server loop,
29 similar in architecture to sshd.
30
32 Kaya standard library by Edwin Brady, Chris Morris and others
33 (kaya@kayalang.org). For further information see http://kayalang.org/
34
36 The Kaya standard library is free software; you can redistribute it
37 and/or modify it under the terms of the GNU Lesser General Public
38 License (version 2.1 or any later version) as published by the Free
39 Software Foundation.
40
41
42
43Kaya December 2010 ServerLoop.serverLoop(3kaya)