xs_init - initialise Crossroads context
void *xs_init ();
function initialises a Crossroads context
. A context
is thread safe and may be shared among as
many application threads as necessary, without any additional locking required
on the part of the caller.
The individual sockets
within a context
— applications may not
use a single socket
from multiple threads.
A socket may
from one thread to another, by
issuing a full memory barrier between individual calls on the socket
For example, this means applications can create a socket in one thread with
and then pass it to a newly created
thread as part
of thread initialization via a structure passed as an argument to
. Context options may be set prior to creating the first
socket within a context
, using the xs_setctxopt()
(3) for details on the available context options.
. Multiple contexts
may coexist within a single
application. Thus, an application can use Crossroads directly and at the same
time make use of any number of additional libraries or components which
themselves make use of Crossroads.
function shall return an opaque handle to the initialised
if successful. Otherwise it shall return NULL and set
to one of the values defined below.
No error values are defined.
The Crossroads documentation was written by Martin Sustrik <
> and Martin Lucina <