MCPcopy Create free account
hub / github.com/boostorg/beast / snippets

Function snippets

test/doc/websocket_5_control_frames.cpp:27–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "websocket_common.ipp"
26
27void
28snippets()
29{
30 stream<tcp_stream> ws(ioc);
31
32 {
33 //[code_websocket_5_1
34
35 ws.control_callback(
36 [](frame_type kind, string_view payload)
37 {
38 // Do something with the payload
39 boost::ignore_unused(kind, payload);
40 });
41
42 //]
43 }
44
45 {
46 //[code_websocket_5_2
47
48 ws.close(close_code::normal);
49
50 //]
51 }
52
53 {
54 //[code_websocket_5_3
55
56 ws.auto_fragment(true);
57 ws.write_buffer_bytes(16384);
58
59 //]
60 }
61}
62
63struct websocket_5_test
64 : public boost::beast::unit_test::suite

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected