@head @module serversocket @title serversocket: Network server

This module supports creating TCP servers that listen on a specified port and accept incoming connections. @see The socket module allows creating TCP clients. @end

Class ServerSocket

@class ServerSocket(port as Int[, address as Str]) @desc Construct a TCP/IP server socket listening on the specified port of the local host. If the address argument is omitted or is nil, the server socket will listen to all the network interfaces. Otherwise, only the specified IP address will be listened to. The address must be of the form "123.45.67.89" (in decimal). @end

ServerSocket methods

@fun accept([buffering as Constant]) @desc Wait for an incoming connection. Return a @ref{socket::Socket} object that represents the new connection.

The buffering parameter specifies the buffering mode of the socket. If omitted, the connection is unbuffered. Valid values for the parameter are @ref{io::Buffered}, @ref{io::LineBuffered} and @ref{io::Unbuffered}. @end @fun close() @desc Close the socket. Free any resources allocated to the socket. @end @end-class