Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
websocket::stream::compress (1 of 2 overloads)

Set the compress message write option.

Synopsis
void
compress(
    bool value);
Description

This controls whether or not outgoing messages should be compressed. The setting is only applied when

This function permits adjusting per-message compression. Changing the opcode after a message is started will only take effect after the current message being sent is complete. The default setting is to compress messages whenever the conditions above are true.

Parameters

Name

Description

value

true if outgoing messages should be compressed

Example

Disabling compression for a single message.

ws.compress( false );
ws.write(net::buffer(s), ec);
ws.compress( true );

PrevUpHomeNext