Skip to content

Commit

Permalink
Dispose check
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloet committed Feb 6, 2020
1 parent 856608a commit d77cc56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions SimpleSockets/Client/SimpleSocketTcpSslClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,19 @@ protected override async void ReceiveCallback(IAsyncResult result)
}
catch (Exception ex)
{
DisposeSslStream();
RaiseErrorThrown(ex);
_mreReceiving.Set();
_mreRead.Set();
state.Reset();
// Receive(state);
if (!Disposed)
{
DisposeSslStream();
if (_mreReceiving != null)
_mreReceiving.Set();
if (_mreRead != null)
_mreRead.Set();
state.Reset();
}

}

}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion Tests/Test.Sockets.Parallel/TcpSslParallelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TcpSslParallelTests

private IList<SimpleSocketClient> _clients = new List<SimpleSocketClient>();

private int _numClients = 25;
private int _numClients = 15;
private int _numMessages = 1000;
private X509Certificate2 _cert;

Expand Down

0 comments on commit d77cc56

Please sign in to comment.