summaryrefslogtreecommitdiffstats
path: root/PROTOCOL.md
diff options
context:
space:
mode:
Diffstat (limited to 'PROTOCOL.md')
-rw-r--r--PROTOCOL.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/PROTOCOL.md b/PROTOCOL.md
index e69de29..d17eded 100644
--- a/PROTOCOL.md
+++ b/PROTOCOL.md
@@ -0,0 +1,40 @@
+# SOLEC protocol specification
+
+## Data format
+
+Everything is big endian. `text` is always null terminated UTF-8.
+Every packet starts with `uint8` denoting type of the rest of remaining data.
+
+## Event types
+
+| Type | Name |
+|------|-----------|
+| 0x01 | Handshake |
+| 0x02 | Ping |
+| 0x03 | Pong |
+
+## Events
+
+### Handshake
+
+Sent after estabilishing TCP connection. First by the client and then by the server.
+If one of the sides uses different protocol version connection should be aborted.
+
+| Type | Name | Description |
+|-------|------|------------------|
+| uint8 | ver | Protocol version |
+
+
+### Ping
+
+Empty.
+
+### Pong
+
+`time` field contains Unix timestamp generated just before sending the packet.
+Timezone should always be UTC.
+
+| Type | Name | Description |
+|--------|------|------------------|
+| uint64 | time | Unix timestamp |
+