Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
5fef480a
Commit
5fef480a
authored
Mar 10, 2010
by
Martin Lucina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to TCP wire format specification
parent
8f90ae8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
zmq_tcp.txt
doc/zmq_tcp.txt
+26
-16
No files found.
doc/zmq_tcp.txt
View file @
5fef480a
...
@@ -53,12 +53,25 @@ A 'peer address' may be specified by either of the following:
...
@@ -53,12 +53,25 @@ A 'peer address' may be specified by either of the following:
WIRE FORMAT
WIRE FORMAT
-----------
-----------
0MQ messages are transmitted over TCP in frames consisting of the message
0MQ messages are transmitted over TCP in frames consisting of an encoded
length followed by flags byte and the message data. The length MUST correspond
'payload length', followed by a 'flags' field and the message body. The 'payload
to the length of the remaining part of the frame.
length' is defined as the combined length in octets of the message body and the
'flags' field.
. A single 'frame' can be defined by the
For frames with a 'payload length' not exceeding 254 octets, the 'payload
following ABNF grammar:
length' shall be encoded as a single octet. The minimum valid 'payload length'
of a frame is 1 octet, thus a 'payload length' of 0 octets is invalid and such
frames SHOULD be ignored.
For frames with a 'payload length' exceeding 254 octets, the 'payload length'
shall be encoded as a single octet with the value `255` followed by the
'payload length' represented as a 64-bit unsigned integer in network byte
order.
The 'flags' field consists of a single octet reserved for future expansion and
MUST be set to `0`.
The following ABNF grammar represents a single 'frame':
....
....
frame = (length flags data)
frame = (length flags data)
...
@@ -68,39 +81,36 @@ following ABNF grammar:
...
@@ -68,39 +81,36 @@ following ABNF grammar:
data = *OCTET
data = *OCTET
....
....
The following diagram illustrates the layout of a frame with a 'payload length'
For messages of 0 to 253 octets in length, the message length is represented by
not exceeding 254 octets:
a single octet:
....
....
0 1 2 3
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
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
| Flags | Message body ... |
|
Payload length
| Flags | Message body ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message body ...
| Message body ...
+-+-+-+-+-+-+- ...
+-+-+-+-+-+-+- ...
....
....
For messages of 254 or more octets in length, the message length is represented
The following diagram illustrates the layout of a frame with a 'payload length'
by a single octet with the value `255` followed by the message length
exceeding 254 octets:
represented as a 64-bit unsigned integer in network byte order:
....
....
0 1 2 3
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
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
... |
| 0xff |
Payload length
... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Message size
... |
|
Payload length
... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Message size
| Flags | Message body ... |
|
Payload length
| Flags | Message body ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message body ...
| Message body ...
+-+-+-+-+-+-+-+ ...
+-+-+-+-+-+-+-+ ...
....
....
The flags field is reserved and MUST be set to 0.
EXAMPLES
EXAMPLES
--------
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment