class type server_endpoint_acceptor =This class type is for service providers that listen for connections. By calling
accept, one gets an engine that waits for the next connection, and establishes it.
There are services that can only accept one connection for a
certain contact address. In this case
accept must only be called
once. Normally, services can accept any number of connections
(multiplexing), and it is allowed to call
accept again after
the previous accept engine was successful.
method server_address :
method multiple_connections :
method accept :
unit -> (Unix.file_descr * inetspec option) engine
If the connection is successfully established, the state of the engine
fd is the connected file descriptor,
addr (if not-
None) is the endpoint address of the
connecting client (from the server's perspective). Such addresses are
only supported for Internet endpoints. If a proxy is used to accept
the connections, the returned address is that from the proxy's
view, and usually different from what
The close-on-exec flag of the created endpoint descriptor is always set. The endpoint descriptor is always in non-blocking mode.
It is allowed to shut down
fd for sending, and it is required to
fd after all data transfers have been performed.
A call of
accept allows it only to establish one connection at a time.
However, it is allowed to call
accept several times to accept several
connections, provided the acceptor supports this (returned by
multiple_connections). It is only allowed to call
when the previous engine was successful.
method shut_down :
unit -> unit
acceptwas not successful.
If there is a engine waiting for connections, it is aborted.