File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed
Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 11# Specify version format
2- version : " 3.0.5 .{build}"
2+ version : " 3.0.6 .{build}"
33
44# Image to use
55image : Visual Studio 2019
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44 <TargetFramework >netstandard2.1</TargetFramework >
5- <Version >3.0.5 </Version >
5+ <Version >3.0.6 </Version >
66 <Authors >Ivan Shynkarenka</Authors >
77 <Copyright >Copyright (c) 2019-2020 Ivan Shynkarenka</Copyright >
88 <RepositoryUrl >https://github.com/chronoxor/NetCoreServer</RepositoryUrl >
Original file line number Diff line number Diff line change @@ -718,7 +718,12 @@ private void ProcessReceive(SocketAsyncEventArgs e)
718718 {
719719 // If zero is returned from a read operation, the remote end has closed the connection
720720 if ( size > 0 )
721- TryReceive ( ) ;
721+ {
722+ if ( Thread . CurrentThread . ManagedThreadId == _sendThreadId )
723+ ThreadPool . QueueUserWorkItem ( _ => TryReceive ( ) ) ;
724+ else
725+ TryReceive ( ) ;
726+ }
722727 else
723728 DisconnectAsync ( ) ;
724729 }
@@ -768,7 +773,12 @@ private void ProcessSend(SocketAsyncEventArgs e)
768773
769774 // Try to send again if the client is valid
770775 if ( e . SocketError == SocketError . Success )
771- TrySend ( ) ;
776+ {
777+ if ( Thread . CurrentThread . ManagedThreadId == _sendThreadId )
778+ ThreadPool . QueueUserWorkItem ( _ => TrySend ( ) ) ;
779+ else
780+ TrySend ( ) ;
781+ }
772782 else
773783 {
774784 SendError ( e . SocketError ) ;
Original file line number Diff line number Diff line change @@ -551,7 +551,12 @@ private void ProcessReceive(SocketAsyncEventArgs e)
551551 {
552552 // If zero is returned from a read operation, the remote end has closed the connection
553553 if ( size > 0 )
554- TryReceive ( ) ;
554+ {
555+ if ( Thread . CurrentThread . ManagedThreadId == _sendThreadId )
556+ ThreadPool . QueueUserWorkItem ( _ => TryReceive ( ) ) ;
557+ else
558+ TryReceive ( ) ;
559+ }
555560 else
556561 Disconnect ( ) ;
557562 }
@@ -602,7 +607,12 @@ private void ProcessSend(SocketAsyncEventArgs e)
602607
603608 // Try to send again if the session is valid
604609 if ( e . SocketError == SocketError . Success )
605- TrySend ( ) ;
610+ {
611+ if ( Thread . CurrentThread . ManagedThreadId == _sendThreadId )
612+ ThreadPool . QueueUserWorkItem ( _ => TrySend ( ) ) ;
613+ else
614+ TrySend ( ) ;
615+ }
606616 else
607617 {
608618 SendError ( e . SocketError ) ;
You can’t perform that action at this time.
0 commit comments