int s = xsocket (XPF_TCP, XLISTENER); or int s = xsocket (XPF_TCP|XPF_IPC, XLISTENER);
xsocket - create an xio socket
#include <xio/socket.h>
int xsocket(int pf, int socktype);
Creates an xio socket with specified pf and socktype. Returns a file descriptor for the newly created xio socket.
Following pfs are defined at the moment:
TCP transport mechanism
inter-process transport mechanism
in-process transport mechanism
socktype parameter defines the type of the socket, which in turn determines the exact semantics of the socket.
Following socktypes are defined at the moment:
xio listener socket, that is, as a socket that will be used to accept incoming connection requests using xbind[3] or using helper API xlisten[3]
xio connector socket, a socket that will be used to connect to remote listening xio socket using xbind[3] or using helper API xconnect[3]
The newly created xio socket exists in a name space (address family) but has no address assigned to it. see xbind(3) function.
On success, a xio socket descriptor for the new socket is returned. On error, -1 is returned, and errno is set appropriately.
Note that xio socket file descriptors returned are not standard system file descriptors and will exhibit undefined behaviour when used with system functions. Moreover, it may happen that a system file descriptor and file descriptor of an xio socket will incidentally collide (be equal).
Specified address family is not supported or unknown protocol.
The limit on the total number of open xio sockets or OS limit for file descriptors has been reached.
int s = xsocket (XPF_TCP, XLISTENER); or int s = xsocket (XPF_TCP|XPF_IPC, XLISTENER);
Dong Fang <yp.fangdong@gmail.com> Martin Sustrik <sustrik@250bpm.com>