xpra icon
Bug tracker and wiki

Changes between Version 31 and Version 32 of PacketEncoding


Ignore:
Timestamp:
01/12/17 11:38:27 (3 years ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PacketEncoding

    v31 v32  
    1818* one byte for protocol flags (stream encoder used, encryption, etc)
    1919* one byte for compression level hint (0 for uncompressed)
    20 * one byte for the chunk index (0 for main chunk)
     20* one byte for the chunk index (0 for the main chunk)
    2121* one long (4 bytes) for the size of the data that follows
    2222
    2323[[BR]]
    2424The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below).
     25
    2526The main message consists of a list of values, the first item is the packet type (see [/wiki/NetworkProtocol]).
     27
    2628The other chunks replace the item found at the specified index in the main chunk. (which should be empty)
     29The main chunk always comes last.
    2730[[BR]]
    2831
     
    3235== Bencode vs Rencode ==
    3336The main chunk is encoded using one of those stream encoders:
    34 * The old [/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, non ordered keys, and support for unicode
     37* The old [/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, non ordered keys, and support for unicode values
    3538* The newer/faster [/browser/xpra/trunk/src/rencode rencode] mode, based on [https://code.google.com/p/rencode/ this version] with minor tweaks/fixes (packaging info: #683)
    3639* YAML (see r6934) which is much slower, but more widely available
    3740[[BR]]
    3841This allows various languages to implement the xpra protocol, specifying which encoder they want to use (bencode is more widely available than rencode).
    39 We also include a faster bencoder implemented in Cython, which is roughly twice as fast as the pure Python version and does make a difference to the overall performance of the system: [http://xpra.org/stats/bencode/ Cython vs Python bencoder], but rencode is 3 times faster than that still!
     42We also include a faster bencoder implemented in Cython, which is roughly twice as fast as the pure Python version and does make a difference to the overall performance of the system: [http://xpra.org/stats/bencode/ Cython vs Python bencoder], but rencode is 3 times faster than that still.
    4043
    4144The python client and server can specify which packet encoders should be enabled using the switch {{{--packet-encoders=}}} (or via the config file).
     
    4750== Pixels and Icons ==
    4851
    49 '''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.
     52'''Note''': all window pixels, icons and cursors are usually 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.
    5053
    5154The only exception to this rule is the `RGB` encoding, which will use the stream compression on the raw pixels (but it is still called from the pixel compression thread to preserve responsiveness).
     
    5558{{{#!div class="box"
    5659== Compression ==
    57 There are up to 3 compressors supported:
    58 * [http://www.zlib.net/ zlib] - which is always available
     60There are up to 3 types of compressors supported:
     61* [http://www.zlib.net/ zlib] - which is always available but very inefficient
    5962* [https://code.google.com/p/lz4/ lz4] - available on most systems, used by default if present (more information here: #443)
    6063* [http://www.oberhumer.com/opensource/lzo/ lzo] (version 0.14.0 onwards): not as efficient as lz4, but still much faster than zlib.
    6164
    62 In version 0.14.0, you can select which compressors are enabled using the {{{--compressors=}}} switch (or the configuration file).
     65You can select which compressors are enabled using the {{{--compressors=}}} switch (or the equivalent entry in the [/wiki/Configuration configuration] file).
    6366
    6467[[BR]]