-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPROTOCOL
53 lines (37 loc) · 1.53 KB
/
PROTOCOL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
1. client tells server which structs and fields it supports
2. server establishes the format
3. communication is established
1)
+--------------------------+
| num_of_supported_structs |
+--------------------------+
+-------------+
| packet_size |
+-------------+
+------------------------------------------------------------------------------------------------------+
| essential | struct_name | '\0' | essential | size | collabisble_to | struct_field_1_name| '\0' | ... |
+------------------------------------------------------------------------------------------------------+
2)
+----------------------------------------+
| num_of_supported_structs or error_code |
+----------------------------------------+
+-------------+
| packet_size |
+-------------+
+-------------------------------------------------------------------------------------------------------------------+
| struct_name | '\0' | struct_identifier | size | struct_field_name | '\0' | size | struct_field_type | '\0' | ... |
+-------------------------------------------------------------------------------------------------------------------+
3)
+---------------------------+
| packet_size or error code |
+---------------------------+
+---------------------------------------------+
| struct_identifier | struct_field_data | ... |
+---------------------------------------------+
error_codes:
-1: essential struct not supported by client
-2: essential struct not supported by server
-3: timeout
-4: invalid format
-5: general error
-6: network error