3.2. Network Protocol

checkpoint, size, version, and session_id are sent as 64-bit little-endian numbers.

3.2.1. Client to Server

Prefix

Data

Description

joedb

client_version

first message, sent at connection time

P

checkpoint

pull

L

checkpoint

lock-pull

p

checkpoint size data

locked-push

U

checkpoint size data

push-unlock

u

unlock

H

checkpoint hash (32 bytes)

check SHA-256 hash code

i

ping (used to keep the connection alive)

Q

quit

3.2.2. Server to Client

Prefix

Data

Description

joedb

server_version
session_id
checkpoint
‘R’ or ‘W’
reply to joedb.
server_version = 0 means client_version is rejected.
‘R’ is pull-only

P

checkpoint size data

reply to P

L

checkpoint size data

reply to L

U

reply to U or p when the push succeeded

C

reply to U or p when the push failed (conflict)

R

reply to L, p, U or u when the server is read-only

u

reply to u (no timeout)

t

reply to u, U, or p in case of timeout

H

reply to H, hash is matching

h

reply to H, hash mismatch

i

reply to i