GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NN_SOCKET (3)

.ds Aq ’

NAME

nn_socket - create an SP socket

CONTENTS

SYNOPSIS

#include <nanomsg/nn.h>

int nn_socket (int domain, int protocol);

DESCRIPTION

Creates an SP socket with specified domain and protocol. Returns a file descriptor for the newly created socket.

Following domains are defined at the moment:

AF_SP

Standard full-blown SP socket.

AF_SP_RAW

Raw SP socket. Raw sockets omit the end-to-end functionality found in AF_SP sockets and thus can be used to implement intermediary devices in SP topologies.

protocol parameter defines the type of the socket, which in turn determines the exact semantics of the socket. Check manual pages for individual SP protocols to get the list of available socket types.

The newly created socket is initially not associated with any endpoints. In order to establish a message flow at least one endpoint has to be added to the socket using nn_bind(3) or nn_connect(3) function.

Also note that type argument as found in standard socket(2) function is omitted from nn_socket. All the SP sockets are message-based and thus of SOCK_SEQPACKET type.

RETURN VALUE

If the function succeeds file descriptor of the new socket is returned. Otherwise, -1 is returned and errno is set to to one of the values defined below.

Note that file descriptors returned by nn_socket function are not standard file descriptors and will exhibit undefined behaviour when used with system functions. Moreover, it may happen that a system file descriptor and file descriptor of an SP socket will incidentally collide (be equal).

ERRORS

EAFNOSUPPORT

Specified address family is not supported.

EINVAL

Unknown protocol.

EMFILE

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

ETERM

The library is terminating.

EXAMPLE

int s = nn_socket (AF_SP, NN_PUB);
assert (s >= 0);

SEE ALSO

nn_pubsub(7) nn_reqrep(7) nn_pipeline(7) nn_survey(7) nn_bus(7) nn_bind(3) nn_connect(3) nn_close(3) nanomsg(7)

AUTHORS

Martin Sustrik <\m[blue]sustrik@250bpm.com\m[][1]>

NOTES

1. sustrik@250bpm.com  mailto:sustrik@250bpm.com
Search for    or go to Top of page |  Section 3 |  Main Index


nanomsg Unknown NN_SOCKET (3) 03/17/2016

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.