https://github.com/boostorg/beast/issues/1729
| 88 | |
| 89 | // https://github.com/boostorg/beast/issues/1729 |
| 90 | void |
| 91 | testIssue1729() |
| 92 | { |
| 93 | { |
| 94 | net::io_context ioc; |
| 95 | stream<tcp::socket> ws1(ioc); |
| 96 | stream<tcp::socket> ws2(ioc); |
| 97 | test::connect(ws1.next_layer(), ws2.next_layer()); |
| 98 | |
| 99 | ws1.set_option(websocket::stream_base::timeout{ |
| 100 | std::chrono::milliseconds(50), |
| 101 | websocket::stream_base::none(), |
| 102 | false}); |
| 103 | |
| 104 | ws1.async_accept(net::detached); |
| 105 | ws2.async_handshake( |
| 106 | "localhost", "/", net::detached); |
| 107 | ioc.run(); |
| 108 | ioc.restart(); |
| 109 | |
| 110 | flat_buffer b; |
| 111 | error_code ec2; |
| 112 | ws1.async_close({}, |
| 113 | [&ec2](error_code ec) |
| 114 | { |
| 115 | ec2 = ec; |
| 116 | }); |
| 117 | ioc.run(); |
| 118 | BEAST_EXPECTS( |
| 119 | ec2 == beast::error::timeout || |
| 120 | ec2 == net::error::operation_aborted, |
| 121 | ec2.message()); |
| 122 | } |
| 123 | { |
| 124 | net::io_context ioc; |
| 125 | stream<tcp::socket> ws1(ioc); |
| 126 | stream<tcp::socket> ws2(ioc); |
| 127 | test::connect(ws1.next_layer(), ws2.next_layer()); |
| 128 | |
| 129 | ws1.set_option(websocket::stream_base::timeout{ |
| 130 | std::chrono::milliseconds(50), |
| 131 | websocket::stream_base::none(), |
| 132 | false}); |
| 133 | |
| 134 | ws1.async_accept(net::detached); |
| 135 | ws2.async_handshake( |
| 136 | "localhost", "/", net::detached); |
| 137 | ioc.run(); |
| 138 | ioc.restart(); |
| 139 | |
| 140 | flat_buffer b; |
| 141 | error_code ec1, ec2; |
| 142 | ws1.async_read(b, |
| 143 | [&ec1](error_code ec, std::size_t) |
| 144 | { |
| 145 | ec1 = ec; |
| 146 | }); |
| 147 | ws1.async_close({}, |
nothing calls this directly
no test coverage detected