Skip to content

Commit

Permalink
Update for .NET Core 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveOrDevTrying committed May 30, 2023
1 parent 7b20259 commit 5045cb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected virtual async Task ListenForConnectionsAsync(CancellationToken cancell
{
try
{
var client = await _server.AcceptTcpClientAsync(cancellationToken).ConfigureAwait(false);
var client = await _server.AcceptTcpClientAsync().ConfigureAwait(false);

var connection = CreateConnection(new ConnectionTcp
{
Expand Down Expand Up @@ -155,7 +155,7 @@ protected virtual async Task ListenForConnectionsSSLAsync(CancellationToken canc
{
try
{
var client = await _server.AcceptTcpClientAsync(cancellationToken).ConfigureAwait(false);
var client = await _server.AcceptTcpClientAsync().ConfigureAwait(false);
var sslStream = new SslStream(client.GetStream());
await sslStream.AuthenticateAsServerAsync(new SslServerAuthenticationOptions
{
Expand Down
2 changes: 1 addition & 1 deletion TestApps/Tcp.NET.TestApps.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private static void OnConnectionEvent(object sender, TcpConnectionClientEventArg
break;
case ConnectionEventType.Disconnect:
var client = (ITcpNETClient)sender;
_clients.TryRemove(_clients.FirstOrDefault(x => x.Key == client.GetHashCode()));
_clients.TryRemove(client.GetHashCode(), out var _);

client.ConnectionEvent -= OnConnectionEvent;
client.MessageEvent -= OnMessageEvent;
Expand Down

0 comments on commit 5045cb4

Please sign in to comment.