You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/Protocol Specifications/core.md
+77-29Lines changed: 77 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,25 +277,15 @@ The following opcodes are defined by the `core` namespace:
277
277
278
278
##### 3.2.1.3 Sequence numbers `s`
279
279
280
-
Sequence numbers are used as an application-layer packet acknowledgement mechanism in conjunction with
281
-
[heartbeats](#322-heartbeats). This *guarantees* the delivery of all gateway messages sent from a
282
-
home server to a client, especially in suboptimal network conditions.
283
-
284
-
??? question "Doesn't TCP already cover this?"
285
-
286
-
While TCP ensures reliable delivery of data during an active connection, it does not retain
287
-
knowledge of application-layer messages if a disconnect occurs. In such cases, the application
288
-
must implement its own mechanisms to track which messages were successfully received.
289
-
290
-
Application-layer acknowledgements allow the protocol to recover from interruptions by
291
-
identifying any messages that were lost during the disconnect and ensuring they are
292
-
retransmitted, preserving the integrity and completeness of communication between the client
293
-
and server.
294
-
295
280
Sequence numbers are unsigned integers with a 64 bit length. In the rare event that this integer should
296
281
overflow, the server must close the connection to the client and prompt the client to initiate a new,
297
282
non-resumed gateway connection.
298
283
284
+
The sequence number increases by one for every gateway message sent by the server. The client must
285
+
keep track of received sequence numbers as part as the [guaranteed delivery mechanism](#326-guaranteed-delivery-of-gateway-messages-through-package-acknowledgement).
286
+
Every gateway connection has its own sequence number counter, starting at 0 for the first event sent
287
+
by the server.
288
+
299
289
#### 3.2.2 Heartbeats
300
290
301
291
Heartbeats are used to keep the WebSocket connection alive and, combined with [sequence numbers](#3213-sequence-numbers-s),
@@ -325,7 +315,12 @@ in milliseconds at which the client should send heartbeat events to the server.
325
315
326
316
```json
327
317
{
328
-
"heartbeat_interval": 45000
318
+
"n": "core",
319
+
"op": 1,
320
+
"d": {
321
+
"heartbeat_interval": 45000
322
+
},
323
+
"s": 0
329
324
}
330
325
```
331
326
@@ -338,6 +333,8 @@ in milliseconds at which the client should send heartbeat events to the server.
338
333
The "identify" event is sent by the client to the server to let the server know which actor the
339
334
client is.
340
335
336
+
TODO
337
+
341
338
##### 3.2.3.3 Service channels
342
339
343
340
Service channels act like topics in a pub/sub system. They allow clients to subscribe to a specific
@@ -358,7 +355,8 @@ A service channel event payload has the following structure:
358
355
"d": {
359
356
"action": "subscribe",
360
357
"service": "service_name"
361
-
}
358
+
},
359
+
"s": 1
362
360
}
363
361
```
364
362
@@ -381,7 +379,8 @@ was successful or not.
381
379
"service": "service_name",
382
380
"success": false,
383
381
"errorMessage": "Service not found"
384
-
}
382
+
},
383
+
"s": 1
385
384
}
386
385
```
387
386
@@ -395,7 +394,8 @@ was successful or not.
395
394
"action": "subscribe",
396
395
"service": "service_name",
397
396
"success": true,
398
-
}
397
+
},
398
+
"s": 1
399
399
}
400
400
```
401
401
@@ -423,7 +423,8 @@ about the new session mechanism in [section 4.3](#43-protection-against-misuse-b
|`serial`| uint64 | The serial number of the invalidated ID-Cert |
460
+
|`invalidSince`| uint64 | UNIX timestamp of the point in time where this ID-Cert became invalid on |
459
461
|`signature`| string | Signature of a string concatenation of the `invalidSince` timestamp and the `serial` number, in that order. Clients must verify this signature, verifying that the signature was generated by the private key of the revoked certificate. |
460
462
461
463
##### 3.2.3.6 Resume event
@@ -479,7 +481,8 @@ of this event contains the ASCII-PEM encoded ID-Cert of the server.
0 commit comments