Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c02c9f20e4 | ||
|
|
61429b9dde |
No files matched your search
@@ -147,9 +147,9 @@ void TCPConnection::doWrite() {
|
||||
resetTimeout();
|
||||
boost::asio::async_write(socket_, writeBuffer_,
|
||||
boost::asio::bind_executor(strand_,
|
||||
boost::bind(&TCPConnection::handleWrite, shared_from_this(),
|
||||
boost::asio::placeholders::error,
|
||||
boost::asio::placeholders::bytes_transferred)));
|
||||
[self = shared_from_this()](const boost::system::error_code &error, std::size_t /*bytes_transferred*/) {
|
||||
self->handleWrite(error);
|
||||
}));
|
||||
} catch (std::exception &error) {
|
||||
log_->write(
|
||||
std::string("[" + to_string(uuid_) + "] [TCPConnection doWrite] [catch] ") + error.what(),
|
||||
@@ -158,7 +158,7 @@ void TCPConnection::doWrite() {
|
||||
}
|
||||
}
|
||||
|
||||
void TCPConnection::handleWrite(const boost::system::error_code &error, std::size_t bytes_transferred) {
|
||||
void TCPConnection::handleWrite(const boost::system::error_code &error) {
|
||||
cancelTimeout();
|
||||
if (!error) {
|
||||
doRead();
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
void handleRead(const boost::system::error_code &error,
|
||||
size_t bytes_transferred);
|
||||
void doWrite();
|
||||
void handleWrite(const boost::system::error_code &error, std::size_t bytes_transferred);
|
||||
void handleWrite(const boost::system::error_code &error);
|
||||
void socketShutdown();
|
||||
|
||||
private:
|
||||
|
||||
Reference in new issue
Block a user