local-hostname-and-portPortable Socketsopen-connectionmake-passive-socketGoTo Top

make-passive-socket   port &key backlog interface reuse-address => passive-socket[Function]

Create a passive socket that can accept connections.

Package   :portable-sockets

Module   :portable-sockets

Arguments and values

port     An integer or a string specifying the service port
backlog     An integer (default is 5)
interface     A 32-bit internet address or a string specifying a network interface on the local machine or nil
reuse-address     A generalized boolean (default is nil)
passive-socket     A passive socket

The new passive socket.

An interface string can be either a host name, such as "localhost" or a “dotted” IP address, such as "".

The value of backlog tells the operating system how many unprocessed connections can be held pending (connected but still awaiting an accept-connection).

See also

Create a passive socket, listening on port 5555:

  > (make-passive-socket 5555)
  #<passive socket waiting for connection at */5555>

The passive socket should be closed using close-passive-socket when the service is no longer needed in order to free up operating system resources.

The GBBopen Project

local-hostname-and-portPortable Socketsopen-connectionmake-passive-socketGoTo Top