Browse Source

check accepted socket for error

pull/157/head
orignal 10 years ago
parent
commit
8e75d8c39a
  1. 22
      NTCPSession.cpp

22
NTCPSession.cpp

@ -792,8 +792,15 @@ namespace transport @@ -792,8 +792,15 @@ namespace transport
{
if (!error)
{
LogPrint (eLogInfo, "Connected from ", conn->GetSocket ().remote_endpoint());
conn->ServerLogin ();
boost::system::error_code ec;
auto ep = conn->GetSocket ().remote_endpoint(ec);
if (!ec)
{
LogPrint (eLogInfo, "Connected from ", ep);
conn->ServerLogin ();
}
else
LogPrint (eLogError, "Connected from error ", ec.message ());
}
@ -809,8 +816,15 @@ namespace transport @@ -809,8 +816,15 @@ namespace transport
{
if (!error)
{
LogPrint (eLogInfo, "Connected from ", conn->GetSocket ().remote_endpoint());
conn->ServerLogin ();
boost::system::error_code ec;
auto ep = conn->GetSocket ().remote_endpoint(ec);
if (!ec)
{
LogPrint (eLogInfo, "Connected from ", ep);
conn->ServerLogin ();
}
else
LogPrint (eLogError, "Connected from error ", ec.message ());
}
if (error != boost::asio::error::operation_aborted)

Loading…
Cancel
Save