xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Changes between Version 17 and Version 18 of PacketEncoding


Ignore:
Timestamp:
06/05/14 06:33:00 (7 years ago)
Author:
Antoine Martin
Comment:

add more chunk info

Legend:

Unmodified
Added
Removed
Modified
  • PacketEncoding

    v17 v18  
    66* [/wiki/NetworkProtocol Network Protocol] for the actual contents of the packets
    77
     8{{{#!div class="box"
     9== Wire Format ==
     10Each 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]]
     13Each 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]]
     21The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below).
     22The main message consists of a list of values, the first item is the packet type (see [[/wiki/NetworkProtocol]).
     23The other chunks replace the item found at the specified index in the main chunk. (which should be empty)
     24[[BR]]
     25
     26}}}
    827
    928{{{#!div class="box"
    1029== Bencode vs Rencode ==
    11 Each packet exchanged between the client and server is encoded using one of those two stream encoders:
     30The main chunk is encoded using one of those two stream encoders:
    1231* 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
    1332* 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
     
    2140== Pixels and Icons ==
    2241
    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.
    2443
    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).
     44The 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).
    2645}}}
    2746