diff --git a/server/server.cpp b/server/server.cpp index 4aa1cc1..155c155 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -274,12 +274,18 @@ bool CTcpServer::send_frame(std::shared_ptr socket, CFram logger_->error("{} pack failed.", __FUNCTION__); return false; } - if (!socket->send(asio::buffer(out_buf, out_len))) { - logger_->error("{} send failed, buf type:{}, fid:{}, tid:{}", __FUNCTION__, - static_cast(buf->type_), buf->fid_, buf->tid_); - delete[] out_buf; - return false; + try { + if (!socket->send(asio::buffer(out_buf, out_len))) { + logger_->error("{} send failed, buf type:{}, fid:{}, tid:{}", __FUNCTION__, + static_cast(buf->type_), buf->fid_, buf->tid_); + delete[] out_buf; + return false; + } + } catch (const std::exception& e) { + logger_->error("send failed, type:{}, fid:{}, tid:{}, mark:{}", static_cast(buf->type_), + buf->fid_, buf->tid_, buf->mark_); } + delete[] out_buf; return true; }