source: apps/ministreaming/doc/protocol.txt @ 2a619f3

Last change on this file since 2a619f3 was 2a619f3, checked in by zzz <zzz@…>, 17 years ago

Slightly updated specs
(human)

  • Property mode set to 100644
File size: 2.1 KB
Line 
1ministreaming protocol
2**********************
3
4Each message looks like the following
5
61 byte  type
73 byte  id
8x byte  payload.
9
10messages from client to server have type 0xA0 to 0xAF,
11messages from server to client have type 0x50 to 0x5F.
12
13Each "connections" has 2 IDs, a client ID and a server ID.
14These IDs may be any 3-byte values except 00 00 00, which is reserved.
15
16All connections are created as PROP_RELIABILITY_GUARANTEED.
17
18"actions" are the things a proper ministreaming implementation SHOULD
19do when it receives such a message.
20
21A "ministreaming connection" is a connection where the user of the
22library can send data into or receive from.
23
24Client->Server:
25===============
26
270xA0 Send data
28  id:      the server id
29  payload: the data to send
30  actions: send the data to the ministreaming connection
31
320xA1 SYN
33  id:      the client id
34  payload: the public key dynamically created by the client
35  actions: create a server ID and create a ministreaming connection. When
36           successful, send an ACK back, otherwise a close.
37
380xA2 Close
39  id:      the server id
40  payload: nothing
41  actions: close the connection
42
43Server->Client
44==============
45
460x50 Send data
47  id:      the client id
48  payload: the data to send
49  actions: send the data to the ministreaming connection
50
510x51 ACK
52  id:      the client id
53  payload: the server id
54  actions: nothing
55
560x52 Close
57  id:      the client id
58  payload: nothing
59  actions: close the connection
60
61
62Sample conversations:
63=====================
64
65a) Service not available (e.g. the server is not accepting connections)
66
67C->S  A1 12 34 56 key... (SYN, client ID = 12 34 56)
68S->C  52 12 34 56  (Close)
69
70b) Service available, server sends data, client closes
71
72C->S  A1 23 45 67 key...   (SYN)
73S->C  51 23 45 67 98 76 54 (ACK, server ID = 98 76 54)
74S->C  50 23 45 67 data     (Send data)
75C->S  A2 98 76 54          (Close)
76
77c) Service available, client sends data first, server closes after answer (HTTP)
78
79C->S A1 11 11 11 key...    (SYN)
80S->C 51 11 11 11 FF FF FF  (ACK)
81C->S A0 FF FF FF data      (send data)
82S->C 50 11 11 11 data      (answer with data)
83S->C 50 11 11 11 data      (more data)
84S->C 51 11 11 11           (Close)
85
Note: See TracBrowser for help on using the repository browser.