Changes between Version 17 and Version 18 of PacketEncoding
- Timestamp:
- 06/05/14 06:33:00 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PacketEncoding
v17 v18 6 6 * [/wiki/NetworkProtocol Network Protocol] for the actual contents of the packets 7 7 8 {{{#!div class="box" 9 == Wire Format == 10 Each message may be split into multiple packets: large binary chunks (ie: compressed pixel data, large clipboard data, etc) will be sent in their own packet, skipping the generic compression layer. 11 12 [[BR]] 13 Each chunk is preceded by an 8 byte header containing: 14 * the magic value "P" (char value 80 in decimal, {{{0x50}}} in hexadecimal) 15 * one byte for protocol flags 16 * one byte for compression level hint 17 * one byte for the chunk index 18 * one long (4 bytes) for the data size that follows 19 20 [[BR]] 21 The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below). 22 The main message consists of a list of values, the first item is the packet type (see [[/wiki/NetworkProtocol]). 23 The other chunks replace the item found at the specified index in the main chunk. (which should be empty) 24 [[BR]] 25 26 }}} 8 27 9 28 {{{#!div class="box" 10 29 == Bencode vs Rencode == 11 Each packet exchanged between the client and serveris encoded using one of those two stream encoders:30 The main chunk is encoded using one of those two stream encoders: 12 31 * The old [http://xpra.org/trac/browser/xpra/trunk/src/xpra/net/bencode.py bencode] mode (see [http://en.wikipedia.org/wiki/Bencode Bencode on wikipedia]): a modified bencoder which supports non string keys in dictionaries, and support for unicode 13 32 * The newer/faster [http://xpra.org/trac/browser/xpra/trunk/src/xpra/net/rencode rencode] mode, based on [https://code.google.com/p/rencode/ this version] with minor tweaks/fixes … … 21 40 == Pixels and Icons == 22 41 23 '''Note''': all window pixels, icons and cursors are sent using dedicated [/wiki/Encodings picture encodings] and bypass the stream encoder completely (for efficiency). Pixel compression is done in its own thread, to improve responsiveness.42 '''Note''': all window pixels, icons and cursors are sent in their own chunk using dedicated [/wiki/Encodings picture encodings] and bypass the stream encoder completely (for efficiency). Pixel compression is done in its own thread, to improve responsiveness. 24 43 25 The only exception to this rule is the `RGB` encoding, which will use the stream encoder on the raw pixels (but still called from the pixel compression thread).44 The only exception to this rule is the `RGB` encoding, which will use the stream compression on the raw pixels (it still called from the pixel compression thread). 26 45 }}} 27 46