-
Notifications
You must be signed in to change notification settings - Fork 0
/
zgossip.bnf
44 lines (30 loc) · 1.7 KB
/
zgossip.bnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
The following ABNF grammar defines the ZeroMQ Gossip Protocol:
C:HELLO ( C:PUBLISH / S:PUBLISH / heartbeat )
heartbeat = C:PING / S:PONG
; Client says hello to server
HELLO = signature %d1 version
signature = %xAA %xA0 ; two octets
version = number-1 ; Version = 1
; Client or server announces a new tuple
PUBLISH = signature %d2 version key value ttl
version = number-1 ; Version = 1
key = string ; Tuple key, globally unique
value = longstr ; Tuple value, as printable string
ttl = number-4 ; Time to live, msecs
; Client signals liveness
PING = signature %d3 version
version = number-1 ; Version = 1
; Server responds to ping; note that pongs are not correlated with
; pings, and may be mixed with other commands, and the client should
; treat any incoming traffic as valid activity.
PONG = signature %d4 version
version = number-1 ; Version = 1
; Server rejects command as invalid
INVALID = signature %d5 version
version = number-1 ; Version = 1
; Strings are always length + text contents
string = number-1 *VCHAR
longstr = number-4 *VCHAR
; Numbers are unsigned integers in network byte order
number-1 = 1OCTET
number-4 = 4OCTET