mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 04:47:29 +02:00
@ -1,6 +1,7 @@
|
||||
Version 99:
|
||||
|
||||
* Log the value of LIB_DIR for doc builds (debug)
|
||||
* Use correct handler signature in fail_op
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -225,9 +225,9 @@ operator()(error_code ec, std::size_t)
|
||||
ws_.wr_op_.maybe_invoke();
|
||||
if(! dispatched_)
|
||||
ws_.stream_.get_io_service().post(
|
||||
bind_handler(std::move(h_), ec));
|
||||
bind_handler(std::move(h_), ec, 0));
|
||||
else
|
||||
h_(ec);
|
||||
h_(ec, 0);
|
||||
}
|
||||
|
||||
} // websocket
|
||||
|
@ -277,6 +277,15 @@ public:
|
||||
return ws.read(buffer);
|
||||
}
|
||||
|
||||
template<
|
||||
class NextLayer, class MutableBufferSequence>
|
||||
std::size_t
|
||||
read_some(stream<NextLayer>& ws,
|
||||
MutableBufferSequence const& buffers) const
|
||||
{
|
||||
return ws.read_some(buffers);
|
||||
}
|
||||
|
||||
template<
|
||||
class NextLayer, class ConstBufferSequence>
|
||||
void
|
||||
@ -518,6 +527,20 @@ public:
|
||||
return bytes_written;
|
||||
}
|
||||
|
||||
template<
|
||||
class NextLayer, class MutableBufferSequence>
|
||||
std::size_t
|
||||
read_some(stream<NextLayer>& ws,
|
||||
MutableBufferSequence const& buffers) const
|
||||
{
|
||||
error_code ec;
|
||||
auto const bytes_written =
|
||||
ws.async_read_some(buffers, yield_[ec]);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
return bytes_written;
|
||||
}
|
||||
|
||||
template<
|
||||
class NextLayer, class ConstBufferSequence>
|
||||
void
|
||||
@ -1674,6 +1697,17 @@ public:
|
||||
|
||||
bool once;
|
||||
|
||||
// read_some
|
||||
{
|
||||
c.write(ws, sbuf("Hello"));
|
||||
char buf[10];
|
||||
auto const bytes_written =
|
||||
c.read_some(ws, buffer(buf, sizeof(buf)));
|
||||
BEAST_EXPECT(bytes_written == 5);
|
||||
buf[5] = 0;
|
||||
BEAST_EXPECT(string_view(buf) == "Hello");
|
||||
}
|
||||
|
||||
// send ping and message
|
||||
{
|
||||
once = false;
|
||||
|
Reference in New Issue
Block a user