XSocket API  2.0
XIA Socket Library
Functions
Xsocket.c File Reference

Xsocket() - create a socket. More...

#include "Xsocket.h"

Functions

int Xsocket (int family, int transport_type, int protocol)
 Create an XIA socket. More...
 

Function Documentation

int Xsocket ( int  family,
int  transport_type,
int  protocol 
)

Creates an XIA socket of the specified type.

Parameters
familysocket family, currently must be AF_XIA
transport_typeValid values are:
SOCK_STREAM for reliable communications (SID)
SOCK_DGRAM for a ligher weight connection, but with unguranteed delivery (SID)
SOCK_RAW for a raw socket that can have direct edits made to the header
SOCK_NONBLOCK may be or'd into the transport_type to create the socket in nonblocking mode
protocolfor posix compatibility, currently ignored
Returns
socket id on success.
-1 on failure with errno set to an error compatible with those from the standard socket call.
Warning
The returned socket is actually a normal UDP socket on localhost that is used to communicate with the click XIA implementation. Using this socket with normal unix socket calls will cause unexpected behaviors. Attempting to pass a socket created with the the standard socket function to the Xsocket API will have similar results.