Skip to content

zlisten()

Pradeep S B edited this page Aug 20, 2014 · 4 revisions

#####int zlisten ( int sockfd, int backlog )

zlisten() call intercepts the listen system call.

zlisten() 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 zaccept.

#include "zerosocket.h"
⋮
int rc;
int server_sock;
⋮
rc = zlisten(server_sock,5);

######Parameters

parameter Description
sockfd The sockfd argument is a file descriptor that refers to a socket of type SOCK_STREAM or SOCK_SEQPACKET.
backlog The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow.

######Returns On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

######See Also zaccept

zlisten man listen

Clone this wiki locally