|
About Us People Research Publications Funding Download SMesh Spines Spread Secure Spread |
NAME
spines_socket - create an endpoint for communication with Spines
SYNOPSIS
#include "spines_lib.h"
int spines_socket(int domain, int type, int protocol,
const struct sockaddr *serv_addr);
DESCRIPTION
spines_socket creates an endpoint for communication and returns
a descriptor.
The domain parameter specifies a communication domain; this
selects the protocol family which will be used for
communication. The currently understood formats include:
Name Purpose
PF_SPINES Regular Spines communication
The socket has the indicated type, which specifies the
communication semantics. Currently defined types are:
SOCK_STREAM
Provides sequenced, reliable, two-way, connection-based
byte streams.
SOCK_DGRAM
Supports datagrams (connectionless, unreliable messages
of a fixed maximum length).
The protocol specifies both the communication prototol between
the client application and the Spines daemon, and the protocol
used by the Spines daemons to forward messages initiated from
this particular socket. The protocol is specified as a binary
OR between two flags:
Communication between the client application and the daemon:
TCP_CONNECT
TCP communication
UDP_CONNECT
UDP communication
Message forwarding between the Spines daemons for this
particular socket:
UDP_LINKS
best effort forwarding
RELIABLE_LINKS
messages are sent reliably between daemons
SOFT_REALTIME_LINKS
message losses are attempted to be recovered, but
only if they are likely to be recovered within a
certain time frame
By default, if the Protocol is set to zero, Spines will use
TCP_CONNECT, and UDP_LINKS.
Different sockets connected to the same or different Spines
daemons can use different values for their protocol parameter.
The location of the Spines daemon is denoted by serv_addr. If
serv_addr is set to NULL, then the address set by spines_init()
is used, or if spines_init() was not called, it is assumed to
be the localhost on port 8100.
RETURN VALUE
-1 is returned if an error occurs; otherwise the return value
is a descriptor referencing the socket.
|