NAME

xconnect - create a connector xio socket

SYNOPSIS

#include <xio/socket.h>

int xconnect (const char *addr);

DESCRIPTION

Connect to the specified remote 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 the connection succeeds, a xio socket file descriptor for the new socket is returned. On error, -1 is returned, and errno is set appropriately.

ERRORS

EMFILE

Maximum number of active xio sockets was reached.

EINVAL

The syntax of the supplied address is invalid.

EPROTO

The requested transport protocol is not supported.

EXAMPLE

s = xconnect ("ipc://127.0.0.1:8080");
assert (s >= 0);

SEE ALSO

xpf_inproc(7) xpf_ipc(7) xpf_net(7) xsocket(3) xbind(3) xio(7)

AUTHORS

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