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 34 and Version 35 of PacketEncoding


Ignore:
Timestamp:
04/11/20 13:51:49 (16 months ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PacketEncoding

    v34 v35  
    1111{{{#!div class="box"
    1212== Wire Format ==
    13 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.
     13Each message may be split into multiple network packets as large binary chunks (ie: compressed pixel data, large clipboard data, etc) will be sent in their own packet, skipping the generic compression layer.
     14
     15The `compression` command line option only affects regular packets, not binary chunks. It is rarely a good idea to change it.
     16
     17In most cases, the packets are so small that compression is not even attempted.
     18The data that does need to be compressed (ie: pixel data) uses other controls (ie: speed and quality options).
    1419
    1520[[BR]]
     
    2227
    2328[[BR]]
    24 The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below).
     29The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below), and sent last.
     30Each message consists of a list of values, the first item is the packet type (see [/wiki/NetworkProtocol]).
    2531
    26 The main message consists of a list of values, the first item is the packet type (see [/wiki/NetworkProtocol]).
    27 
    28 The other chunks replace the item found at the specified index in the main chunk. (which should be empty)
    29 The main chunk always comes last.
     32The other chunks replace the items found at the specified index in the main chunk.
     33ie:
     34* chunk 1: some png pixel data
     35* chunk 0 (the main packet): `[draw, ..., placeholder for the png data, ...]`
    3036[[BR]]
    3137
     
    4349
    4450The python client and server can specify which packet encoders should be enabled using the switch {{{--packet-encoders=}}} (or via the config file).
    45 For backwards compatibility, you should always enable {{{bencode}}} as this is the encoding used by default for connecting.
     51For backwards compatibility, you should always enable {{{bencode}}} as some clients may use this encoding (ie: html5 client), at least initially.
    4652}}}
    4753
     
    5864{{{#!div class="box"
    5965== Compression ==
    60 There are up to 3 types of compressors supported:
     66There are 3 compressors supported:
    6167* [http://www.zlib.net/ zlib] - which is always available but very inefficient
    62 * [https://code.google.com/p/lz4/ lz4] - available on most systems, used by default if present (more information here: #443, [http://ticki.github.io/blog/how-lz4-works/ how lz4 works])
    63 * [http://www.oberhumer.com/opensource/lzo/ lzo] not as efficient as lz4, but still much faster than zlib.
     68* [https://code.google.com/p/lz4/ lz4] - used by default if present, fast! (more information here: #443, [http://ticki.github.io/blog/how-lz4-works/ how lz4 works])
     69* [http://www.oberhumer.com/opensource/lzo/ lzo] not as efficient as lz4, but still much faster than zlib
     70
     71All [/wiki/Platforms supported platforms] have lz4 so zlib and lzo should not be used.
    6472
    6573You can select which compressors are enabled using the {{{--compressors=}}} switch (or the equivalent entry in the [/wiki/Configuration configuration] file).
     
    6775[[BR]]
    6876
    69 The compression level can be specified via the command line ("{{{-z LEVEL}}}" or "{{{--compress=LEVEL}}}").
     77The compression level can be specified via the command line ("{{{-z LEVEL}}}" or "{{{--compress=LEVEL}}}"). It is generally best to not modify this option unless you really understand the implications.
    7078
    7179Here is what the {{{LEVEL}}} does:
     
    8593}}}
    8694
    87 {{{#!div class="box"
    88 == python-lz4 / python-lzo Installation ==
    89 We have an [/browser/xpra/trunk/rpmbuild/python-lz4.spec python-lz4 rpm specfile] and {{{RPM}}}s should be available for {{{Fedora}}} and {{{CentOS}}} 6.x in the RPM repository.
    90 [[BR]]
    91 Other distributions can install from source: [https://pypi.python.org/pypi/lz4 lz4].
    92 Some distributions provide packages for {{{python-lzo}}}
    93 [[BR]]
    94 The MS Windows and Mac OSX binary installers include lz4 (all builds) and lzo (Python 2.x only).
    95 }}}
    9695
    9796{{{#!div class="box"
     
    10099The default settings should end up using {{{lz4}}} and {{{rencode}}}, since those are by far the best options.
    101100
    102 The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: {{{Android}}}, html5..).
     101The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: [/wiki/Clients/HTML5 HTML5])
    103102
    104103You can also change the current encoder/compressor at runtime: