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
+54-15Lines changed: 54 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,9 +38,12 @@ weight: 0
38
38
-[3.2.3.7 Server certificate change event](#3237-server-certificate-change-event)
39
39
-[3.2.3.8 Heartbeat and heartbeat ACK events](#3238-heartbeat-and-heartbeat-ack-events)
40
40
-[3.2.4 Establishing a connection](#324-establishing-a-connection)
41
+
-[3.2.5 Closing a connection](#325-closing-a-connection)
42
+
-[3.2.6 Guaranteed delivery of gateway messages through package acknowledgement](#326-guaranteed-delivery-of-gateway-messages-through-package-acknowledgement)
41
43
-[3.3 Events over REST](#33-events-over-rest)
42
44
-[3.4 HTTP](#34-http)
43
45
-[3.5 Internet Protocol (IP)](#35-internet-protocol-ip)
46
+
-[3.6 Compression](#36-compression)
44
47
-[4. Federated identity](#4-federated-identity)
45
48
-[4.1 Authentication](#41-authentication)
46
49
-[4.1.1 Authenticating on a foreign server](#411-authenticating-on-a-foreign-server)
@@ -243,7 +246,7 @@ on the specific event.
243
246
|`n`| string |[Namespace](#82-namespaces) context for this payload. |
244
247
|`op`| uint16 | Gateway Opcode indicating the type of payload. |
245
248
|`d`| JSON value | The event data associated with this payload. |
246
-
|`s`|uint32| Sequence number of the event, used for guaranteed, ordered delivery |
249
+
|`s`|uint64| Sequence number of the event, used for guaranteed, ordered delivery |
247
250
248
251
##### 3.2.1.1 Namespaces `n`
249
252
@@ -274,31 +277,42 @@ The following opcodes are defined by the `core` namespace:
274
277
275
278
##### 3.2.1.3 Sequence numbers `s`
276
279
277
-
<!-->
278
-
TODO
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.
280
283
281
-
!!! bug TODO
284
+
??? question "Doesn't TCP already cover this?"
282
285
283
-
How are we going to do sequence numbers? Requirements are:
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.
284
294
285
-
- Guaranteed, ordered delivery of payloads
286
-
- Notice delivery gaps, especially when connection stability is flawed
0 commit comments