WebSocket writes return the bytes transferred (API Change):

* Stream write operations now return the number of bytes
transferred from the caller's input buffers.

Actions Required:

* Modify websocket write completion handlers to receive
  the extra std::size_t bytes_transferred parameter.
This commit is contained in:
Vinnie Falco
2017-09-03 20:05:19 -07:00
parent 942bca0cc3
commit c0e5f14702
19 changed files with 287 additions and 129 deletions
+2 -1
View File
@@ -744,11 +744,12 @@ public:
});
BEAST_EXPECT(ws.rd_block_);
ws.async_write(buffer(s),
[&](error_code ec)
[&](error_code ec, std::size_t n)
{
if(ec)
BOOST_THROW_EXCEPTION(
system_error{ec});
BEAST_EXPECT(n == s.size());
++count;
});
BEAST_EXPECT(ws.wr_block_);