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::binary (1 of 2 overloads)

Set the binary message write option.

Synopsis
void
binary(
    bool value);
Description

This controls whether or not outgoing message opcodes are set to binary or text. The setting is only applied at the start when a caller begins a new message. 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 send text messages.

Parameters

Name

Description

value

true if outgoing messages should indicate binary, or false if they should indicate text.

Example

Setting the message type to binary.

ws.binary(true);

PrevUpHomeNext