nn_tcp man page

nn_tcp — TCP transport mechanism

Synopsis

#include <nanomsg/nn.h>

#include <nanomsg/tcp.h>

Description

TCP transport allows for passing messages over the network using simple reliable one-to-one connections. TCP is the most widely used transport protocol, it is virtually ubiquitous and thus the transport of choice for communication over the network.

When binding a TCP socket address of the form tcp://interface:port should be used. Port is the TCP port number to use. Interface is one of the following (optionally placed within square brackets):

When connecting a TCP socket address of the form tcp://interface;address:port should be used. Port is the TCP port number to use. Interface is optional and specifies which local network interface to use. If not specified, OS will select an appropriate interface itself. If specified it can be one of the following (optionally placed within square brackets):

Finally, address specifies the remote address to connect to. It can be one of the following (optionally placed within square brackets):

Socket Options

NN_TCP_NODELAY

This option, when set to 1, disables Nagle’s algorithm. It also disables delaying of TCP acknowledgments. Using this option improves latency at the expense of throughput. Type of this option is int. Default value is 0.

Example

nn_bind (s1, "tcp://*:5555");
nn_connect (s2, "tcp://myserver:5555");

See Also

nn_inproc(7) nn_ipc(7) nn_bind(3) nn_connect(3) nanomsg(7)

Authors

Martin Sustrik

Referenced By

nanomsg(7), nn_bind(3), nn_connect(3), nn_inproc(7), nn_ipc(7), nn_ws(7).

2019-07-25   nanomsg 1.1.5