Changes between Version 34 and Version 35 of PacketEncoding
- Timestamp:
- 04/11/20 13:51:49 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PacketEncoding
v34 v35 11 11 {{{#!div class="box" 12 12 == 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. 13 Each 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 15 The `compression` command line option only affects regular packets, not binary chunks. It is rarely a good idea to change it. 16 17 In most cases, the packets are so small that compression is not even attempted. 18 The data that does need to be compressed (ie: pixel data) uses other controls (ie: speed and quality options). 14 19 15 20 [[BR]] … … 22 27 23 28 [[BR]] 24 The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below). 29 The main chunk containing the message uses index 0 and it is encoded (see bencode / rencode below), and sent last. 30 Each message consists of a list of values, the first item is the packet type (see [/wiki/NetworkProtocol]). 25 31 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. 32 The other chunks replace the items found at the specified index in the main chunk. 33 ie: 34 * chunk 1: some png pixel data 35 * chunk 0 (the main packet): `[draw, ..., placeholder for the png data, ...]` 30 36 [[BR]] 31 37 … … 43 49 44 50 The 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.51 For backwards compatibility, you should always enable {{{bencode}}} as some clients may use this encoding (ie: html5 client), at least initially. 46 52 }}} 47 53 … … 58 64 {{{#!div class="box" 59 65 == Compression == 60 There are up to 3 types ofcompressors supported:66 There are 3 compressors supported: 61 67 * [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 71 All [/wiki/Platforms supported platforms] have lz4 so zlib and lzo should not be used. 64 72 65 73 You can select which compressors are enabled using the {{{--compressors=}}} switch (or the equivalent entry in the [/wiki/Configuration configuration] file). … … 67 75 [[BR]] 68 76 69 The compression level can be specified via the command line ("{{{-z LEVEL}}}" or "{{{--compress=LEVEL}}}"). 77 The 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. 70 78 71 79 Here is what the {{{LEVEL}}} does: … … 85 93 }}} 86 94 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 }}}96 95 97 96 {{{#!div class="box" … … 100 99 The default settings should end up using {{{lz4}}} and {{{rencode}}}, since those are by far the best options. 101 100 102 The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: {{{Android}}}, html5..).101 The {{{zlib}}} and {{{bencode}}} options will remain for compatibility with clients which do not have support for them (ie: [/wiki/Clients/HTML5 HTML5]) 103 102 104 103 You can also change the current encoder/compressor at runtime: