mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-29 18:27:48 +02:00
Minor logging improvement
This commit is contained in:
parent
cd07f7cbe7
commit
210f522b29
1 changed files with 12 additions and 3 deletions
|
@ -160,19 +160,28 @@ namespace SMBLibrary.Server
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
catch (ObjectDisposedException)
|
||||||
{
|
{
|
||||||
|
state.LogToServer(Severity.Debug, "The connection was terminated");
|
||||||
m_connectionManager.ReleaseConnection(state);
|
m_connectionManager.ReleaseConnection(state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (SocketException)
|
catch (SocketException ex)
|
||||||
{
|
{
|
||||||
|
const int WSAECONNRESET = 10054;
|
||||||
|
if (ex.ErrorCode == WSAECONNRESET)
|
||||||
|
{
|
||||||
|
state.LogToServer(Severity.Debug, "The connection was forcibly closed by the remote host");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
state.LogToServer(Severity.Debug, "The connection was terminated, Socket error code: {0}", ex.ErrorCode);
|
||||||
|
}
|
||||||
m_connectionManager.ReleaseConnection(state);
|
m_connectionManager.ReleaseConnection(state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numberOfBytesReceived == 0)
|
if (numberOfBytesReceived == 0)
|
||||||
{
|
{
|
||||||
// The other side has closed the connection
|
state.LogToServer(Severity.Debug, "The client closed the connection");
|
||||||
state.LogToServer(Severity.Debug, "The other side closed the connection");
|
|
||||||
m_connectionManager.ReleaseConnection(state);
|
m_connectionManager.ReleaseConnection(state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue