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_BIND (3)

.ds Aq ’

NAME

nn_bind - add a local endpoint to the socket

CONTENTS

SYNOPSIS

#include <nanomsg/nn.h>

int nn_bind (int s, const char *addr);

DESCRIPTION

Adds a local endpoint to the socket s. The endpoint can be then used by other applications to connect to.

The addr argument consists of two parts as follows: transport://address. The transport specifies the underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol.

For the list of available transport protocols check the list on nanomsg(7) manual page.

Maximum length of the addr parameter is specified by NN_SOCKADDR_MAX defined in <nanomsg/nn.h> header file.

Note that nn_bind and nn_connect(3) may be called multiple times on the same socket thus allowing the socket to communicate with multiple heterogeneous endpoints.

RETURN VALUE

If the function succeeds positive endpoint ID is returned. Endpoint ID can be later used to remove the endpoint from the socket via nn_shutdown(3) function.

If the function fails, then -1 is returned and errno is set to to one of the values defined below.

ERRORS

EBADF

The provided socket is invalid.

EMFILE

Maximum number of active endpoints was reached.

EINVAL

The syntax of the supplied address is invalid.

ENAMETOOLONG

The supplied address is too long.

EPROTONOSUPPORT

The requested transport protocol is not supported.

EADDRNOTAVAIL

The requested endpoint is not local.

ENODEV

Address specifies a nonexistent interface.

EADDRINUSE

The requested local endpoint is already in use.

ETERM

The library is terminating.

EXAMPLE

s = nn_socket (AF_SP, NN_PUB);
eid1 = nn_bind (s, "inproc://test");
eid2 = nn_bind (s, "tcp://127.0.0.1:5560");

SEE ALSO

nn_inproc(7) nn_ipc(7) nn_tcp(7) nn_socket(3) nn_connect(3) nn_shutdown(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_BIND (3) 03/17/2016

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