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)
|
||||
{
|
||||
state.LogToServer(Severity.Debug, "The connection was terminated");
|
||||
m_connectionManager.ReleaseConnection(state);
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
if (numberOfBytesReceived == 0)
|
||||
{
|
||||
// The other side has closed the connection
|
||||
state.LogToServer(Severity.Debug, "The other side closed the connection");
|
||||
state.LogToServer(Severity.Debug, "The client closed the connection");
|
||||
m_connectionManager.ReleaseConnection(state);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue