-
Notifications
You must be signed in to change notification settings - Fork 39
Compression Overview
tylerje edited this page Oct 23, 2014
·
1 revision
ServiceWire allows you to compress large payloads. By default, compression is turned off. If you have a very fast network, using compression will generally not help you. However, if you are transmitting large amounts of data over a slower connection, e.g. the Internet, then you may want to consider turning on compression and setting the compression size threashold as shown below.
var useCompression = true;
var compressionThreshold = 131072; //128KB
var nphost = new NpHost(pipeName, logger, stats);
nphost.UseCompression = useCompression;
nphost.CompressionThreshold = compressionThreshold;
nphost.AddService<INetTester>(tester);
nphost.AddService<IMyTester>(mytester);
nphost.Open();