SYNOPSIS
DESCRIPTION
This function is used with TCP sockets that have been set up to accept incoming connections using rawio:bind() and rawio:listen().
The call takes the first pending connection from the incoming queue and creates a new socket handle that is connected to the peer which requested the connection. The new socket is in the connected state, while the listening socket keeps on listening.
In blocking mode, if no connections are pending, the call waits until a new connection arrives. In non-blocking mode, an error is returned in that case.
To process incoming connections using an event loop, set the socket to non-blocking mode and add an event handler that waits for the socket to become readable using event:add(). When the event callback is triggered, the socket is ready for another call to rawio:accept().