Swim::Wire
Binary SWIM packet. The layout is fixed so encode and decode do not allocate.
0 magic "SWIM" 4
4 version 1
5 type 1
6 change count 1
7 flags 1
8 sequence 8
16 sender endpoint 19
35 target endpoint 19
54 changes 28 each, at most 5
An endpoint is family (1), port (2), address (16).
Constants
ACK = 2_u8
CHANGE = 28
ENDPOINT = 19
HEADER = 54
MAX_BYTES = HEADER + (MAX_CHANGES * CHANGE)
MAX_CHANGES = 5
PING = 1_u8
PING_REQ = 3_u8
VERSION = 1_u8
Class methods
Writes the header. The change count starts at 0.
Writes one gossip change and stores the new count.