summaryrefslogtreecommitdiff
path: root/doc/zmq_tcp.txt
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-03-10 12:40:13 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-03-10 12:40:13 +0100
commit8f90ae8dfdf5efbb6c8429897dc95cad621af00b (patch)
treec0ff240ca45d39c09032d35507c7229e876c8d40 /doc/zmq_tcp.txt
parent98801ebcaea1117ae596a3bae0653c3720a94359 (diff)
wire formats in docs clarified
Diffstat (limited to 'doc/zmq_tcp.txt')
-rw-r--r--doc/zmq_tcp.txt22
1 files changed, 13 insertions, 9 deletions
diff --git a/doc/zmq_tcp.txt b/doc/zmq_tcp.txt
index c6eba21..3f21352 100644
--- a/doc/zmq_tcp.txt
+++ b/doc/zmq_tcp.txt
@@ -54,32 +54,35 @@ A 'peer address' may be specified by either of the following:
WIRE FORMAT
-----------
0MQ messages are transmitted over TCP in frames consisting of the message
-length followed by the message data. The size of the message data MUST
-correspond to the message length. A single 'frame' can be defined by the
+length followed by flags byte and the message data. The length MUST correspond
+to the length of the remaining part of the frame.
+
+. A single 'frame' can be defined by the
following ABNF grammar:
....
- frame = (message-length message-data)
- message-length = OCTET / (escape 8OCTET)
+ frame = (length flags data)
+ length = OCTET / (escape 8OCTET)
+ flags = OCTET
escape = %xFF
- message-data = *OCTET
+ data = *OCTET
....
-For messages of 0 to 254 octets in length, the message length is represented by
+For messages of 0 to 253 octets in length, the message length is represented by
a single octet:
....
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 size | Flags | Message body ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message body ...
+-+-+-+-+-+-+- ...
....
-For messages of 255 or more octets in length, the message length is represented
+For messages of 254 or more octets in length, the message length is represented
by a single octet with the value `255` followed by the message length
represented as a 64-bit unsigned integer in network byte order:
@@ -91,12 +94,13 @@ represented as a 64-bit unsigned integer in network byte order:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message size ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-| Message size | Message body ... |
+| Message size | Flags | Message body ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message body ...
+-+-+-+-+-+-+-+ ...
....
+The flags field is reserved and MUST be set to 0.
EXAMPLES
--------