NAME

xlisten - create a listener xio socket

SYNOPSIS

#include <xio/socket.h>

int xlisten (const char *addr);

DESCRIPTION

Listen on the specified sockaddr, this is a helper function for xsocket[3] + xbind[3].

The addr argument consists of two parts as follows: transport://address. The transport specifies the underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol.

Maximum length of the addr parameter is specified by XSOCKADDRLEN defined in <xio/socket.h> header file.

RETURN VALUE

If listen succeeds, a listener xio socket file descriptor is returned. On error, -1 is returned, and errno is set appropriately.

ERRORS

EMFILE

Maximum number of active endpoints was reached.

EINVAL

The syntax of the supplied address is invalid.

EPROTO

The requested transport protocol is not supported.

EXAMPLE

s = xlisten ("ipc:///tmp/test.ipc");
assert (s >= 0);

SEE ALSO

xpf_inproc(7) xpf_ipc(7) xpf_tcp(7) xsocket(3) xbind(3) xclose(3) xio(7)

AUTHORS

Dong Fang <yp.fangdong@gmail.com>
Martin Sustrik <sustrik@250bpm.com>