XSocket API  2.0
XIA Socket Library
Functions
Xlisten.c File Reference

Xlisten() - listen for connections on a socket. More...

#include "Xsocket.h"

Functions

int Xlisten (int sockfd, int backlog)
 listen for connections on a socket More...
 

Function Documentation

int Xlisten ( int  sockfd,
int  backlog 
)

Xlisten() marks the socket referred to by sockfd as a passive socket, that is, as a socket that will be used to accept incoming connection requests using Xaccept().

The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow. If a connection request arrives when the queue is full, the client will receive an error with an indication of ECONNREFUSED.

Note
See the man page for the standard listen() call for more details.
Parameters
sockfdan Xsocket previously created with the SOCK_STREAM type, and bound to a local DAG with Xbind()
backlogthe number of outstanding connections allowed in the listen queue
Returns
0 on success
-1 on error with errno set appropriately