From ca50b37fef935f9c0a70dd29b49a3cf98f5600f0 Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Mon, 22 Feb 2021 17:41:22 +0300 Subject: [PATCH] TcpServer call OnConnected after object disposed #115 --- .appveyor.yml | 2 +- source/NetCoreServer/NetCoreServer.csproj | 2 +- source/NetCoreServer/SslClient.cs | 2 +- source/NetCoreServer/SslSession.cs | 2 +- source/NetCoreServer/TcpClient.cs | 2 +- source/NetCoreServer/TcpSession.cs | 2 +- source/NetCoreServer/UdpClient.cs | 2 +- source/NetCoreServer/UdpServer.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bd62440..2f422dc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,5 @@ # Specify version format -version: "5.0.10.{build}" +version: "5.0.11.{build}" # Image to use image: Visual Studio 2019 diff --git a/source/NetCoreServer/NetCoreServer.csproj b/source/NetCoreServer/NetCoreServer.csproj index 28d91cd..cc2f918 100644 --- a/source/NetCoreServer/NetCoreServer.csproj +++ b/source/NetCoreServer/NetCoreServer.csproj @@ -2,7 +2,7 @@ net5.0 - 5.0.10.0 + 5.0.11.0 Ivan Shynkarenka Copyright (c) 2019-2021 Ivan Shynkarenka https://github.com/chronoxor/NetCoreServer diff --git a/source/NetCoreServer/SslClient.cs b/source/NetCoreServer/SslClient.cs index b86ad4c..0e6d803 100644 --- a/source/NetCoreServer/SslClient.cs +++ b/source/NetCoreServer/SslClient.cs @@ -532,7 +532,7 @@ public virtual bool SendAsync(byte[] buffer, long offset, long size) _sending = true; // Try to send the main buffer - Task.Factory.StartNew(TrySend); + TrySend(); } return true; diff --git a/source/NetCoreServer/SslSession.cs b/source/NetCoreServer/SslSession.cs index 4f03eda..c7a6278 100644 --- a/source/NetCoreServer/SslSession.cs +++ b/source/NetCoreServer/SslSession.cs @@ -333,7 +333,7 @@ public virtual bool SendAsync(byte[] buffer, long offset, long size) _sending = true; // Try to send the main buffer - Task.Factory.StartNew(TrySend); + TrySend(); } return true; diff --git a/source/NetCoreServer/TcpClient.cs b/source/NetCoreServer/TcpClient.cs index 0c58bec..79a7a57 100644 --- a/source/NetCoreServer/TcpClient.cs +++ b/source/NetCoreServer/TcpClient.cs @@ -472,7 +472,7 @@ public virtual bool SendAsync(byte[] buffer, long offset, long size) _sending = true; // Try to send the main buffer - Task.Factory.StartNew(TrySend); + TrySend(); } return true; diff --git a/source/NetCoreServer/TcpSession.cs b/source/NetCoreServer/TcpSession.cs index 0b635fa..039c859 100644 --- a/source/NetCoreServer/TcpSession.cs +++ b/source/NetCoreServer/TcpSession.cs @@ -303,7 +303,7 @@ public virtual bool SendAsync(byte[] buffer, long offset, long size) _sending = true; // Try to send the main buffer - Task.Factory.StartNew(TrySend); + TrySend(); } return true; diff --git a/source/NetCoreServer/UdpClient.cs b/source/NetCoreServer/UdpClient.cs index dde26af..63a4b8d 100644 --- a/source/NetCoreServer/UdpClient.cs +++ b/source/NetCoreServer/UdpClient.cs @@ -496,7 +496,7 @@ public virtual bool SendAsync(EndPoint endpoint, byte[] buffer, long offset, lon _sendEndpoint = endpoint; // Try to send the main buffer - Task.Factory.StartNew(TrySend); + TrySend(); return true; } diff --git a/source/NetCoreServer/UdpServer.cs b/source/NetCoreServer/UdpServer.cs index 5c478d4..96902ac 100644 --- a/source/NetCoreServer/UdpServer.cs +++ b/source/NetCoreServer/UdpServer.cs @@ -460,7 +460,7 @@ public virtual bool SendAsync(EndPoint endpoint, byte[] buffer, long offset, lon _sendEndpoint = endpoint; // Try to send the main buffer - Task.Factory.StartNew(TrySend); + TrySend(); return true; }