# Module proc_socket_server # * [Description](#description) * [Function Index](#index) * [Function Details](#functions)
Keeps track of a number of TCP sessions.
This module will manage a collection of TCP sessions for the same
server. If +Port+ is 0, the underlying OS assigns an available
port number. If a +Name+ is not specified, the server will be
named +picoSocketServer_+ plus the TCP port number that the
service listens to, e.g. +picoSocketServer_9923+.
A managed server can be started, stopped, enumerate child
sessions, and limit the maximum number of child sessions.
The conventions used by this module look quite different than
OTP-based services, due to its origin.
.
## Function Index ##
cold_start/7 | |
server_children/1 | |
server_children/2 | |
server_port/1 | |
server_port/2 | |
server_status/1 | |
server_status/2 | |
start_child/3 | |
start_raw_server/5 | |
start_raw_server/7 | |
start_server/3 | Start a new UBF contract-using server.
|
start_server/4 | |
stop_server/1 |
Start a new UBF contract-using server.
This server accepts up to Max connections on TCP port Port.
SpawnOpts are the erlang garbage collection options for the spawned process.
Each time a new connection is made, Fun(Socket) is called.
------
Fun = fun(Socket) -> exit(normal) | exit(socket_closed) |
exit({socket_error, Reason}) | exit(timeout).
------
Fun will handle all of the protocol communication for a single TCP
session.
A raw server uses packet length 0 (see start_raw_server/5 and
start_raw_server/7).