forked from boostorg/beast
auto_fragment is a member of stream (API Change):
fix #374, fix #446 * auto_fragment option struct is removed Actions Required: * Change call sites which use auto_fragment with set_option to call stream::auto_fragment instead.
This commit is contained in:
1 parent
669b1feae1
commit
f22895224b
9 files changed
+99
-230
No files matched your search
@@ -22,43 +22,6 @@
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
/** Automatic fragmentation option.
|
||||
|
||||
Determines if outgoing message payloads are broken up into
|
||||
multiple pieces.
|
||||
|
||||
When the automatic fragmentation size is turned on, outgoing
|
||||
message payloads are broken up into multiple frames no larger
|
||||
than the write buffer size.
|
||||
|
||||
The default setting is to fragment messages.
|
||||
|
||||
@note Objects of this type are used with
|
||||
@ref beast::websocket::stream::set_option.
|
||||
|
||||
@par Example
|
||||
Setting the automatic fragmentation option:
|
||||
@code
|
||||
...
|
||||
websocket::stream<ip::tcp::socket> stream(ios);
|
||||
stream.set_option(auto_fragment{true});
|
||||
@endcode
|
||||
*/
|
||||
#if BEAST_DOXYGEN
|
||||
using auto_fragment = implementation_defined;
|
||||
#else
|
||||
struct auto_fragment
|
||||
{
|
||||
bool value;
|
||||
|
||||
explicit
|
||||
auto_fragment(bool v)
|
||||
: value(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
/** Message type option.
|
||||
|
||||
This controls the opcode set for outgoing messages. Valid
|
||||
|
||||
@@ -151,6 +151,41 @@ public:
|
||||
*/
|
||||
~stream() = default;
|
||||
|
||||
/** Set the automatic fragmentation option.
|
||||
|
||||
Determines if outgoing message payloads are broken up into
|
||||
multiple pieces.
|
||||
|
||||
When the automatic fragmentation size is turned on, outgoing
|
||||
message payloads are broken up into multiple frames no larger
|
||||
than the write buffer size.
|
||||
|
||||
The default setting is to fragment messages.
|
||||
|
||||
@note Objects of this type are used with
|
||||
@ref beast::websocket::stream::set_option.
|
||||
|
||||
@par Example
|
||||
Setting the automatic fragmentation option:
|
||||
@code
|
||||
...
|
||||
websocket::stream<ip::tcp::socket> stream{ios};
|
||||
stream.auto_fragment(true);
|
||||
@endcode
|
||||
*/
|
||||
void
|
||||
auto_fragment(bool v)
|
||||
{
|
||||
wr_autofrag_ = v;
|
||||
}
|
||||
|
||||
/// Returns `true` if the automatic fragmentation option is set.
|
||||
bool
|
||||
auto_fragment() const
|
||||
{
|
||||
return wr_autofrag_;
|
||||
}
|
||||
|
||||
/** Set options on the stream.
|
||||
|
||||
The application must ensure that calls to set options
|
||||
@@ -173,13 +208,6 @@ public:
|
||||
std::forward<An>(an)...);
|
||||
}
|
||||
|
||||
/// Set the automatic fragment size option
|
||||
void
|
||||
set_option(auto_fragment const& o)
|
||||
{
|
||||
wr_autofrag_ = o.value;
|
||||
}
|
||||
|
||||
/// Set the outgoing message type
|
||||
void
|
||||
set_option(message_type const& o)
|
||||
|
||||
Reference in new issue
Block a user