| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e61e019 commit 7b73bb8
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | # Specify version format | |
| 2 | - version: "3.0.5.{build}" | ||
| 2 | + version: "3.0.6.{build}" | ||
| 3 | 3 | ||
| 4 | 4 | # Image to use | |
| 5 | 5 | image: Visual Studio 2019 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | <PropertyGroup> | |
| 4 | 4 | <TargetFramework>netstandard2.1</TargetFramework> | |
| 5 | - <Version>3.0.5</Version> | ||
| 5 | + <Version>3.0.6</Version> | ||
| 6 | 6 | <Authors>Ivan Shynkarenka</Authors> | |
| 7 | 7 | <Copyright>Copyright (c) 2019-2020 Ivan Shynkarenka</Copyright> | |
| 8 | 8 | <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) | |||
| 718 | 718 | { | |
| 719 | 719 | // If zero is returned from a read operation, the remote end has closed the connection | |
| 720 | 720 | if (size > 0) | |
| 721 | - TryReceive(); | ||
| 721 | + { | ||
| 722 | + if (Thread.CurrentThread.ManagedThreadId == _sendThreadId) | ||
| 723 | + ThreadPool.QueueUserWorkItem(_ => TryReceive()); | ||
| 724 | + else | ||
| 725 | + TryReceive(); | ||
| 726 | + } | ||
| 722 | 727 | else | |
| 723 | 728 | DisconnectAsync(); | |
| 724 | 729 | } | |
@@ -768,7 +773,12 @@ private void ProcessSend(SocketAsyncEventArgs e) | |||
| 768 | 773 | ||
| 769 | 774 | // Try to send again if the client is valid | |
| 770 | 775 | if (e.SocketError == SocketError.Success) | |
| 771 | - TrySend(); | ||
| 776 | + { | ||
| 777 | + if (Thread.CurrentThread.ManagedThreadId == _sendThreadId) | ||
| 778 | + ThreadPool.QueueUserWorkItem(_ => TrySend()); | ||
| 779 | + else | ||
| 780 | + TrySend(); | ||
| 781 | + } | ||
| 772 | 782 | else | |
| 773 | 783 | { | |
| 774 | 784 | SendError(e.SocketError); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -551,7 +551,12 @@ private void ProcessReceive(SocketAsyncEventArgs e) | |||
| 551 | 551 | { | |
| 552 | 552 | // If zero is returned from a read operation, the remote end has closed the connection | |
| 553 | 553 | if (size > 0) | |
| 554 | - TryReceive(); | ||
| 554 | + { | ||
| 555 | + if (Thread.CurrentThread.ManagedThreadId == _sendThreadId) | ||
| 556 | + ThreadPool.QueueUserWorkItem(_ => TryReceive()); | ||
| 557 | + else | ||
| 558 | + TryReceive(); | ||
| 559 | + } | ||
| 555 | 560 | else | |
| 556 | 561 | Disconnect(); | |
| 557 | 562 | } | |
@@ -602,7 +607,12 @@ private void ProcessSend(SocketAsyncEventArgs e) | |||
| 602 | 607 | ||
| 603 | 608 | // Try to send again if the session is valid | |
| 604 | 609 | if (e.SocketError == SocketError.Success) | |
| 605 | - TrySend(); | ||
| 610 | + { | ||
| 611 | + if (Thread.CurrentThread.ManagedThreadId == _sendThreadId) | ||
| 612 | + ThreadPool.QueueUserWorkItem(_ => TrySend()); | ||
| 613 | + else | ||
| 614 | + TrySend(); | ||
| 615 | + } | ||
| 606 | 616 | else | |
| 607 | 617 | { | |
| 608 | 618 | SendError(e.SocketError); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments