mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 10:47:48 +02:00
Client: Update IsConnected on EndReceive socket exception
This commit is contained in:
parent
5c4e369896
commit
b0912850dd
2 changed files with 6 additions and 0 deletions
|
@ -436,17 +436,20 @@ namespace SMBLibrary.Client
|
||||||
}
|
}
|
||||||
catch (ArgumentException) // The IAsyncResult object was not returned from the corresponding synchronous method on this class.
|
catch (ArgumentException) // The IAsyncResult object was not returned from the corresponding synchronous method on this class.
|
||||||
{
|
{
|
||||||
|
m_isConnected = false;
|
||||||
state.ReceiveBuffer.Dispose();
|
state.ReceiveBuffer.Dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
catch (ObjectDisposedException)
|
||||||
{
|
{
|
||||||
|
m_isConnected = false;
|
||||||
Log("[ReceiveCallback] EndReceive ObjectDisposedException");
|
Log("[ReceiveCallback] EndReceive ObjectDisposedException");
|
||||||
state.ReceiveBuffer.Dispose();
|
state.ReceiveBuffer.Dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (SocketException ex)
|
catch (SocketException ex)
|
||||||
{
|
{
|
||||||
|
m_isConnected = false;
|
||||||
Log("[ReceiveCallback] EndReceive SocketException: " + ex.Message);
|
Log("[ReceiveCallback] EndReceive SocketException: " + ex.Message);
|
||||||
state.ReceiveBuffer.Dispose();
|
state.ReceiveBuffer.Dispose();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -369,17 +369,20 @@ namespace SMBLibrary.Client
|
||||||
}
|
}
|
||||||
catch (ArgumentException) // The IAsyncResult object was not returned from the corresponding synchronous method on this class.
|
catch (ArgumentException) // The IAsyncResult object was not returned from the corresponding synchronous method on this class.
|
||||||
{
|
{
|
||||||
|
m_isConnected = false;
|
||||||
state.ReceiveBuffer.Dispose();
|
state.ReceiveBuffer.Dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
catch (ObjectDisposedException)
|
||||||
{
|
{
|
||||||
|
m_isConnected = false;
|
||||||
Log("[ReceiveCallback] EndReceive ObjectDisposedException");
|
Log("[ReceiveCallback] EndReceive ObjectDisposedException");
|
||||||
state.ReceiveBuffer.Dispose();
|
state.ReceiveBuffer.Dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (SocketException ex)
|
catch (SocketException ex)
|
||||||
{
|
{
|
||||||
|
m_isConnected = false;
|
||||||
Log("[ReceiveCallback] EndReceive SocketException: " + ex.Message);
|
Log("[ReceiveCallback] EndReceive SocketException: " + ex.Message);
|
||||||
state.ReceiveBuffer.Dispose();
|
state.ReceiveBuffer.Dispose();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue