Jun 28, 2013 at 9:22 AM
Edited Jun 28, 2013 at 9:24 AM
compression is only enabled for messages larger than CompressionThreshold.
The defaulf value of the threshold is 1 << 16 (64 kilobytes),
so it must be the reason why you don't notice any compression.
The idea behind the CompressionThreshold is that smaller messages
don't benefit from compression (you gain just a handful of hundred bytes),
but might slow your the application down noticeably, especially under heavy load.
Try sending larger messages or adjust the CompressionThreshold
setting of your protocol setup value like this:
protocol.CompressionThreshold = 1024; // one kilobyte
It must be done before creating ZyanConnection.
Please note that setting CompressionThreshold to 0
disables the compression, so the minimum value for this property is 1 byte.