summaryrefslogtreecommitdiff
path: root/doc/zmq_tcp.txt
diff options
context:
space:
mode:
authorMartin Hurton <hurtonm@gmail.com>2010-02-10 17:14:21 +0100
committerMartin Hurton <hurtonm@gmail.com>2010-02-10 17:14:21 +0100
commit7cab423fc20e46f54fa561e51b566cc8a63ca5c1 (patch)
treefa926432b8392e7717b7fbc1ecaf973ba60cb970 /doc/zmq_tcp.txt
parentbc9b7f1f54b9dcf754021f1f7eb766d71cc97f29 (diff)
parent354efc513fdb4096f8830e6c2e3e8f1311303e61 (diff)
Merge branch 'master' of github.com:sustrik/zeromq2
Diffstat (limited to 'doc/zmq_tcp.txt')
-rw-r--r--doc/zmq_tcp.txt93
1 files changed, 93 insertions, 0 deletions
diff --git a/doc/zmq_tcp.txt b/doc/zmq_tcp.txt
new file mode 100644
index 0000000..98f1219
--- /dev/null
+++ b/doc/zmq_tcp.txt
@@ -0,0 +1,93 @@
+zmq_tcp(7)
+==========
+
+
+NAME
+----
+zmq_tcp - 0MQ unicast TCP transport over the network
+
+
+SYNOPSIS
+--------
+TCP is an ubiquitous unicast transport. When connecting distributed
+applications, you will mostly use TCP transport.
+
+
+CONNECTION STRING
+-----------------
+Connection string for TCP transport is "tcp://" followed by an IP address,
+colon and port number. IP address can be either its numeric representation,
+a NIC name or a hostname (resolved by DNS):
+
+----
+ tcp://192.168.0.111:5555
+ tcp://myserver001:80
+ tcp://lo:32768
+----
+
+Note that NIC names are not standardised by POSIX. They tend to be rather
+arbitrary and platform dependent. Say, "eth0" on Linux would correspond to "en0"
+on OSX and "e1000g" on Solaris. On Windows platform, as there are no short NIC
+names available, you have to use numeric IP addresses instead.
+
+
+WIRE FORMAT
+-----------
+A message consists of a message length followed by message data.
+Size of message data MUST correspond to the message length.
+
+For messages of 0 to 254 octets, the length is represented by single octet.
+
+For messages of 255 or more octets the length is represented by a single octet
+%xFF followed by a 64-bit unsigned integer length in network byte order.
+
+The protocol can be defined by this BNF grammar:
+
+----
+ frame = length data
+ length = OCTET | escape 8*OCTET
+ escape = %xFF
+ data = *OCTET
+----
+
+Binary layout of a message (up to 254 bytes long):
+
+----
+0 1 2 3
+0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Message size | Message body ... |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Message body ...
++-+-+-+-+-+-+- ...
+----
+
+Binary layout of a larger message:
+
+----
+0 1 2 3
+0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| 0xff | Message size ... |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Message size ... |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Message size | Message body ... |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Message body ...
++-+-+-+-+-+-+-+ ...
+----
+
+
+SEE ALSO
+--------
+linkzmq:zmq_udp[7]
+linkzmq:zmq_pgm[7]
+linkzmq:zmq_ipc[7]
+linkzmq:zmq_inproc[7]
+
+
+AUTHOR
+------
+Martin Sustrik <sustrik at 250bpm dot com>
+