Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
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