nn_tcp.adoc 2.2 KB

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