chickadee » socket » socket-accept

socket-accept soprocedure
socket-accept-ready? soprocedure

socket-accept accepts a connection on listening socket so, returning a new connected socket object. The address of the peer can be obtained by calling socket-peer-name on the socket.

This is a non-blocking operation; other SRFI-18 threads can continue to run in the meantime, although this one will block. If the accept does not complete within socket-accept-timeout milliseconds, a timeout error is raised.

socket-accept-ready? tests whether there is a connection waiting to be accepted, so you can avoid blocking the current thread. However, if a peer resets his connection between your testing and accepting, the accept may block nonetheless.