fix: dispatch the first queued message without BeginInvoke - #9
Merged
RobertPoienar merged 2 commits intoAug 10, 2026
Conversation
An app or Desktop that sent its first frame before the server returned from OnOpen was dropped as it connected (AltTester-Server issue sta#181): [Error] Operation is not supported on this platform. [Fatal] Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'. ... disconnected.1006-An exception has occurred while receiving. open() ended by handing the queued message to Delegate.BeginInvoke, which is unsupported on .NET Core and throws PlatformNotSupportedException. The exception escaped open() -> Accept() -> StartSession() into the accept loop, which logged it and closed the TcpClient; that disposed the stream the receive loop was already reading, so the loop died and aborted the session with 1006. Queue the message on the thread pool instead. Only reached when a frame arrives while OnOpen is still running, which is why SDK 2.3.2+ and Desktop hit it (both speak immediately on connect) while older SDKs, silent until the server speaks first, never did.
…message-without-begininvoke
RobertPoienar
approved these changes
Aug 10, 2026
andreion1ca
deleted the
fix/181-dispatch-first-message-without-begininvoke
branch
August 10, 2026 11:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An app or Desktop that sent its first frame before the server returned from OnOpen was dropped as it connected (AltTester-Server issue sta#181):
[Error] Operation is not supported on this platform.
[Fatal] Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
... disconnected.1006-An exception has occurred while receiving.
open() ended by handing the queued message to Delegate.BeginInvoke, which is unsupported on .NET Core and throws PlatformNotSupportedException. The exception escaped open() -> Accept() -> StartSession() into the accept loop, which logged it and closed the TcpClient; that disposed the stream the receive loop was already reading, so the loop died and aborted the session with 1006.
Queue the message on the thread pool instead. Only reached when a frame arrives while OnOpen is still running, which is why SDK 2.3.2+ and Desktop hit it (both speak immediately on connect) while older SDKs, silent until the server speaks first, never did.