Skip to content

fix: stop logging our own teardown as a receive failure - #11

Merged
RobertPoienar merged 1 commit into
AltServer-Websocket-Sharpfrom
fix/teardown-noise-on-disposed-stream
Aug 13, 2026
Merged

RobertPoienar merged 1 commit into
AltServer-Websocket-Sharpfrom
fix/teardown-noise-on-disposed-stream

Conversation

@andreion1ca

Copy link
Copy Markdown

A client whose network dropped is still TCP-connected but will never answer the close handshake. The server writes its close frame, waits out _waitTime for a reply that never arrives, then disposes the transport in releaseServerResources() while the receive loop is still parked in a read. That read then failed with

[Fatal] Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.

once per socket of the departing client, and aborted a connection that was already closing - reported on AltTester-Server issue sta#181 after the connect-time fix landed, where an Android app losing its network logged the pair for its command and live-update legs.

Once closing has begun, a failed read is the expected result of our own teardown, so report receiving as finished and trace it instead. Reads that fail while the connection is still Open keep the Fatal and the abort, which is where they mean something.

A client whose network dropped is still TCP-connected but will never answer
the close handshake. The server writes its close frame, waits out
_waitTime for a reply that never arrives, then disposes the transport in
releaseServerResources() while the receive loop is still parked in a read.
That read then failed with

  [Fatal] Cannot access a disposed object.
  Object name: 'System.Net.Sockets.NetworkStream'.

once per socket of the departing client, and aborted a connection that was
already closing - reported on AltTester-Server issue sta#181 after the
connect-time fix landed, where an Android app losing its network logged the
pair for its command and live-update legs.

Once closing has begun, a failed read is the expected result of our own
teardown, so report receiving as finished and trace it instead. Reads that
fail while the connection is still Open keep the Fatal and the abort, which
is where they mean something.
@RobertPoienar
RobertPoienar merged commit 23bb904 into AltServer-Websocket-Sharp Aug 13, 2026
1 check passed
@andreion1ca
andreion1ca deleted the fix/teardown-noise-on-disposed-stream branch August 13, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants