NAME

sp_endpoint - create an scalability protocol’s endpoint

SYNOPSIS

#include <xio/sp.h>

int sp_endpoint(int sp_family, int sp_type);

DESCRIPTION

Creates an endpoint with specified sp_family and sp_type. Returns a endpoint id for the newly created endpoint. sp_family parameter defines the scalability protocol of the endpoint, which in turn determines the exact semantics of the endpoint. and sp_type parameter defines the type of endpoint.

Following sp_family are defined at the moment:

SP_REQREP

simple many-to-many communication

RETURN VALUE

On success, an eid for the endpoint is returned. On error, -1 is returned, and errno is set appropriately.

Note that eid 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 eid will incidentally collide (be equal).

ERRORS

EINVAL

Specified endpoint type is not supported or unknown.

EMFILE

The limit on the total number of open endpoints or OS limit for file descriptors has been reached.

EXAMPLE

int eid = sp_endpoint (SP_REQREP, SP_REQ);
assert( eid >= 0 );

SEE ALSO

sp_close(3) sp_add(3) sp_rm(3) sp_send(3) sp_recv(3) sp(7)

AUTHORS

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