1NN_TCP(7) nanomsg 1.1.5 NN_TCP(7)
2
3
4
6 nn_tcp - TCP transport mechanism
7
9 #include <nanomsg/nn.h>
10
11 #include <nanomsg/tcp.h>
12
14 TCP transport allows for passing messages over the network using simple
15 reliable one-to-one connections. TCP is the most widely used transport
16 protocol, it is virtually ubiquitous and thus the transport of choice
17 for communication over the network.
18
19 When binding a TCP socket address of the form tcp://interface:port
20 should be used. Port is the TCP port number to use. Interface is one of
21 the following (optionally placed within square brackets):
22
23 • Asterisk character (*) meaning all local network interfaces.
24
25 • IPv4 address of a local network interface in numeric form
26 (192.168.0.111).
27
28 • IPv6 address of a local network interface in numeric form (::1).
29
30 When connecting a TCP socket address of the form
31 tcp://interface;address:port should be used. Port is the TCP port
32 number to use. Interface is optional and specifies which local network
33 interface to use. If not specified, OS will select an appropriate
34 interface itself. If specified it can be one of the following
35 (optionally placed within square brackets):
36
37 • IPv4 address of a local network interface in numeric form
38 (192.168.0.111).
39
40 • IPv6 address of a local network interface in numeric form (::1).
41
42 Finally, address specifies the remote address to connect to. It can be
43 one of the following (optionally placed within square brackets):
44
45 • IPv4 address of a remote network interface in numeric form
46 (192.168.0.111).
47
48 • IPv6 address of a remote network interface in numeric form (::1).
49
50 • The DNS name of the remote box.
51
52 Socket Options
53 NN_TCP_NODELAY
54 This option, when set to 1, disables Nagle’s algorithm. It also
55 disables delaying of TCP acknowledgments. Using this option
56 improves latency at the expense of throughput. Type of this option
57 is int. Default value is 0.
58
60 nn_bind (s1, "tcp://*:5555");
61 nn_connect (s2, "tcp://myserver:5555");
62
64 nn_inproc(7) nn_ipc(7) nn_bind(3) nn_connect(3) nanomsg(7)
65
67 Martin Sustrik <sustrik@250bpm.com>
68
69
70
71 2023-01-19 NN_TCP(7)