Skip to content

Commit

Permalink
Switch from buffered to vectored async_writes.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Feb 8, 2020
1 parent b0139db commit cba7c0e
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 144 deletions.
6 changes: 4 additions & 2 deletions src/overlay/Peer.h
Expand Up @@ -253,7 +253,8 @@ class Peer : public std::enable_shared_from_this<Peer>,
virtual void connectHandler(asio::error_code const& ec);

virtual void
writeHandler(asio::error_code const& error, size_t bytes_transferred)
writeHandler(asio::error_code const& error, size_t bytes_transferred,
size_t messages_transferred)
{
}

Expand All @@ -263,7 +264,8 @@ class Peer : public std::enable_shared_from_this<Peer>,
}

virtual void
readBodyHandler(asio::error_code const& error, size_t bytes_transferred)
readBodyHandler(asio::error_code const& error, size_t bytes_transferred,
size_t expected_length)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/overlay/PeerDoor.cpp
Expand Up @@ -57,8 +57,8 @@ PeerDoor::acceptNextPeer()
}

CLOG(DEBUG, "Overlay") << "PeerDoor acceptNextPeer()";
auto sock = make_shared<TCPPeer::SocketType>(
mApp.getClock().getIOContext(), TCPPeer::BUFSZ, TCPPeer::BUFSZ);
auto sock = make_shared<TCPPeer::SocketType>(mApp.getClock().getIOContext(),
TCPPeer::BUFSZ);
mAcceptor.async_accept(sock->next_layer(),
[this, sock](asio::error_code const& ec) {
if (ec)
Expand Down

0 comments on commit cba7c0e

Please sign in to comment.