Portable Socketsclose-passive-socketaccept-connectionGoTo Top

accept-connection   passive-socket &key wait => socket-stream[Function]

Purpose
Accept a socket-stream connection.

Package   :portable-sockets

Module   :portable-sockets

Arguments and values

passive-socket     A passive socket
wait     A generalized boolean (default is t)
socket-stream     A socket stream

Returns
A socket stream.

See also
    shutdown-socket-stream
    start-connection-server

Example
Accept a connection made to a newly created passive socket:

  > (let* ((passive-socket (make-passive-socket 5555))
           (connection (accept-connection passive-socket)))
       (close-passive-socket passive-socket)
       connection)
  #<socket stream connected from localhost/5555 to localhost/59946>
  >

Note
Connections should always be closed using close (from both sides) to free up operating-system resources when they are no longer needed.


The GBBopen Project


Portable Socketsclose-passive-socketaccept-connectionGoTo Top