Changes for page Server/ Website Communication
Last modified by stu115775 on 2025/01/30 12:17
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.stu115 3341 +XWiki.stu115775 - Content
-
... ... @@ -1,1 +1,168 @@ 1 +The Communication is handled by a WebProvider, wich is a central server in a star pattern. This server waits for clients and applies theire changes and distributes these changes to all interested clients. 2 + 3 +The provided WebProvider listens on port 8089 and is accesed by the Controller which does a protocoll-upgrade to enable full block data-writeing and PHP-instances which provide data for a webside or ServerSendEvents(SSE) 4 + 5 +The communication protocoll is a use-case limmited binary protocol which sends a one byte command followed by a one byte datatype followed by a specific number of data bytes specified by the command and datatype. 6 + 7 +=== Commands: === 8 + 9 +|=((( 10 +Byte 11 +)))|=((( 12 +Name 13 +)))|=((( 14 +Usage 15 +)))|=(% colspan="1" %)(% colspan="1" %) 16 +((( 17 +Data Content 18 +))) 19 +|((( 20 +0x01 21 +)))|((( 22 +Set Data 23 +)))|((( 24 +sets a part of specified data or all if in blockmode 25 +)))|(% colspan="1" %)(% colspan="1" %) 26 +((( 27 +2 bytes, index and value (or all values and no index if only one index exists or blockmode is on) 28 +))) 29 +|((( 30 +0x02 31 +)))|((( 32 +Request Data 33 +)))|((( 34 +requests specified data 35 +)))|(% colspan="1" %)(% colspan="1" %) 36 +((( 37 +no data 38 +))) 39 +|((( 40 +0x03 41 +)))|((( 42 +Enable Stream 43 +)))|((( 44 +request to get updates of specified data 45 +)))|(% colspan="1" %)(% colspan="1" %) 46 +((( 47 +no data 48 +))) 49 +|((( 50 +0x04 51 +)))|((( 52 +Disable Stream 53 +)))|((( 54 +request to stop geting updates of specified data 55 +)))|(% colspan="1" %)(% colspan="1" %) 56 +((( 57 +no data 58 +))) 59 +|((( 60 +0x05 61 +)))|((( 62 +Response Data 63 +)))|((( 64 +response of a data request 65 +)))|(% colspan="1" %)(% colspan="1" %) 66 +((( 67 +full dataset of given datatype 68 +))) 69 +|((( 70 +0x06 71 +)))|((( 72 +Stream Data 73 +)))|((( 74 +an data update notification 75 +)))|(% colspan="1" %)(% colspan="1" %) 76 +((( 77 +full dataset of given datatype 78 +))) 79 +|(% colspan="1" %)(% colspan="1" %) 80 +((( 81 +0x07 82 +)))|(% colspan="1" %)(% colspan="1" %) 83 +((( 84 +Switch to 'Block' protocoll 85 +)))|(% colspan="1" %)(% colspan="1" %) 86 +((( 87 +switch to blockmode, datatype has to have the same value as validation 88 +)))|(% colspan="1" %)(% colspan="1" %) 89 +((( 90 +no data 91 +))) 92 + 93 +=== Datatypes: === 94 + 95 +|=((( 96 +Byte 97 +)))|=((( 98 +Name 99 +)))|=((( 100 +number of bytes 101 +))) 102 +|((( 103 +0x01 104 +)))|((( 105 +Position 106 +)))|((( 107 +NUM_TRAINS = 11 108 +))) 109 +|((( 110 +0x02 111 +)))|((( 112 +Destination 113 +)))|((( 114 +NUM_TRAINS = 11 115 +))) 116 +|((( 117 +0x03 118 +)))|((( 119 +Cleanup 120 +)))|((( 121 +1 122 +))) 123 +|((( 124 +0x04 125 +)))|((( 126 +Randommode 127 +)))|((( 128 +1 129 +))) 130 +|((( 131 +0x05 132 +)))|((( 133 +Lamps 134 +)))|((( 135 +NUM_LAMPS = 24 136 +))) 137 +|((( 138 +0x06 139 +)))|((( 140 +Schedule(actually Station) 141 +)))|((( 142 +NUM_TRAINS = 11 143 +))) 144 +|((( 145 +0x07 146 +)))|((( 147 +Substation 148 +)))|((( 149 +NUM_TRAINS = 11 150 +))) 151 + 152 +=== Running the WebProvider: === 153 + 154 +go into code/interface 155 + 156 +run 'make web' 157 + 158 +run './web' 159 + 160 += Ideas for a new version: = 161 + 162 +(% style="list-style-type: square;" %) 163 +* Don't use fixed datatypes, instead add a command to create a datatype by name and bytesize, which returns a datatypenumber, uniqe for each name, disconnects if size doesn't match with existing. 164 +* Just use a different command to set the full dataset 165 +* don't send updates to a client if the only change was caused by this client (just skip the current client on setting the dirty flag) 166 +* Maybe add a minimum time between updates (prevents SSE and others from being flodded and the website actually crashing by a JavaScript DOS) 167 + 1 1 \\
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -3214565 31 +32145654 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/RP2/pages/3214565 3/Server/ Website Communication1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/RP2/pages/32145654/Server/ Website Communication