AN_ACCEPTSection: Antinat Programmer's Manual (3)
Index Return to Main Contents
The an_accept(3) function is used to accept an incoming connection on a socket that was created earlier and switched into listen mode using the an_listen(3) call. For proxy-based connections, only one incoming connection is allowed on any listening socket. Accepting a connection will use the primary socket for communication and will not create any other socket.
Similar to accept, addr is filled in with the address of the connecting entity and socklen contains the length of addr. If addr is NULL then this data is not returned, but may be retrieved later with a call to an_getpeername(3).
Although there is planned support for non-blocking sockets in a future release, this call should be considered a blocking call. A non-blocking socket will be silently (and temporarily) changed to a blocking one to process the connection.
- The socket handle is invalid.
- Could not read information from the network; a network error occurred.
- There was not enough space to store the resulting socket information into the addr buffer.
- This call cannot be made on the type of socket, or cannot return socket information for this type of connection.
- This call must be called after a prior successful call to an_bind_tosockaddr(3) or an_bind_tohostname(3).
- The proxy failed to successfully process the incoming connection.
Malcolm Smith <email@example.com>
Time: 14:19:43 GMT, January 09, 2005