From b3f600368d5398a988b7aa212917669274f7edf5 Mon Sep 17 00:00:00 2001 From: LiveOrDevTrying Date: Sun, 9 Jul 2023 20:30:47 -0700 Subject: [PATCH] Fix send statement --- Tcp.NET.Client/Handlers/TcpClientHandlerBase.cs | 12 ++++++------ Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs | 8 ++++---- TestApps/Tcp.NET.TestApps.Client/Program.cs | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tcp.NET.Client/Handlers/TcpClientHandlerBase.cs b/Tcp.NET.Client/Handlers/TcpClientHandlerBase.cs index 3693aec..4e72ceb 100644 --- a/Tcp.NET.Client/Handlers/TcpClientHandlerBase.cs +++ b/Tcp.NET.Client/Handlers/TcpClientHandlerBase.cs @@ -47,7 +47,7 @@ public override async Task ConnectAsync(CancellationToken cancellationToke } else { - await CreateNonSSLConnectionAsync(cancellationToken).ConfigureAwait(false); + await CreateConnectionAsync(cancellationToken).ConfigureAwait(false); } if (_connection != null && _connection.TcpClient.Connected && !cancellationToken.IsCancellationRequested) @@ -162,9 +162,9 @@ public override async Task SendAsync(string message, CancellationToken can Bytes = bytes, CancellationToken = cancellationToken })); - - return true; } + + return true; } catch (Exception ex) { @@ -212,9 +212,9 @@ public override async Task SendAsync(byte[] message, CancellationToken can Bytes = bytes, CancellationToken = cancellationToken })); - - return true; } + + return true; } catch (Exception ex) { @@ -349,7 +349,7 @@ protected virtual async Task ReceiveAsync(CancellationToken cancellationToken) await DisconnectAsync(cancellationToken).ConfigureAwait(false); } - protected virtual async Task CreateNonSSLConnectionAsync(CancellationToken cancellationToken) + protected virtual async Task CreateConnectionAsync(CancellationToken cancellationToken) { // Establish the remote endpoint for the socket. _connection?.Dispose(); diff --git a/Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs b/Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs index 016068c..bc889f6 100644 --- a/Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs +++ b/Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs @@ -372,9 +372,9 @@ public override async Task SendAsync(string message, Z connection, Cancell Bytes = bytes, CancellationToken = cancellationToken })); - - return true; } + + return true; } catch (Exception ex) { @@ -421,9 +421,9 @@ public override async Task SendAsync(byte[] message, Z connection, Cancell Bytes = bytes, CancellationToken = cancellationToken })); - - return true; } + + return true; } catch (Exception ex) { diff --git a/TestApps/Tcp.NET.TestApps.Client/Program.cs b/TestApps/Tcp.NET.TestApps.Client/Program.cs index a47e802..029f484 100644 --- a/TestApps/Tcp.NET.TestApps.Client/Program.cs +++ b/TestApps/Tcp.NET.TestApps.Client/Program.cs @@ -114,7 +114,7 @@ private static void OnMessageEvent(object sender, TcpMessageClientEventArgs args case MessageEventType.Sent: break; case MessageEventType.Receive: - //Console.WriteLine(args.Message + " : " + +_clients.Values.Where(x => x.IsRunning).Count()); + Console.WriteLine(args.Message + " : " + +_clients.Values.Where(x => x.IsRunning).Count()); break; default: break;