nn_device man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

NN_DEVICE(3)			nanomsg manual			  NN_DEVICE(3)

NAME
       nn_device - start a device

SYNOPSIS
       #include <nanomsg/nn.h>

       int nn_device (int s1, int s2);

DESCRIPTION
       Starts a device to forward messages between two sockets. If both
       sockets are valid, nn_device function loops and sends and messages
       received from s1 to s2 and vice versa. If only one socket is valid and
       the other is negative, nn_device works in a "loopback" mode — it loops
       and sends any messages received from the socket back to itself.

       To break the loop and make nn_device function exit use nn_term(3)
       function.

RETURN VALUE
       The function loops until it hits an error. In such case it returns -1
       and sets errno to one of the values defined below.

ERRORS
       EBADF
	   One of the provided sockets is invalid.

       EINVAL
	   Either one of the socket is not an AF_SP_RAW socket; or the two
	   sockets don’t belong to the same protocol; or the directionality of
	   the sockets doesn’t fit (e.g. attempt to join two SINK sockets to
	   form a device).

       EINTR
	   The operation was interrupted by delivery of a signal.

       ETERM
	   The library is terminating.

EXAMPLE
	   int s1 = nn_socket (AF_SP_RAW, NN_REQ);
	   nn_bind (s1, "tcp://127.0.0.1:5555");
	   int s2 = nn_socket (AF_SP_RAW, NN_REP);
	   nn_bind (s2, "tcp://127.0.0.1:5556");
	   nn_device (s1, s2);

SEE ALSO
       nn_socket(3) nn_term(3) nanomsg(7)

AUTHORS
       Martin Sustrik <sustrik@250bpm.com[1]>

NOTES
	1. sustrik@250bpm.com
	   mailto:sustrik@250bpm.com

nanomsg Unknown			  12/23/2015			  NN_DEVICE(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net