fix:尝试修正某个客户端崩溃导致与其传输的客户端也崩溃的问题。
This commit is contained in:
parent
ef82c2721e
commit
a486b31e4e
@ -274,12 +274,18 @@ bool CTcpServer::send_frame(std::shared_ptr<asio::ip::tcp::socket> socket, CFram
|
|||||||
logger_->error("{} pack failed.", __FUNCTION__);
|
logger_->error("{} pack failed.", __FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!socket->send(asio::buffer(out_buf, out_len))) {
|
try {
|
||||||
logger_->error("{} send failed, buf type:{}, fid:{}, tid:{}", __FUNCTION__,
|
if (!socket->send(asio::buffer(out_buf, out_len))) {
|
||||||
static_cast<int>(buf->type_), buf->fid_, buf->tid_);
|
logger_->error("{} send failed, buf type:{}, fid:{}, tid:{}", __FUNCTION__,
|
||||||
delete[] out_buf;
|
static_cast<int>(buf->type_), buf->fid_, buf->tid_);
|
||||||
return false;
|
delete[] out_buf;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
logger_->error("send failed, type:{}, fid:{}, tid:{}, mark:{}", static_cast<int>(buf->type_),
|
||||||
|
buf->fid_, buf->tid_, buf->mark_);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] out_buf;
|
delete[] out_buf;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user