Skip to content

Detect closed socket connection - #194

Merged
ndokter merged 1 commit into
ndokter:masterfrom
brambo123:patch-1
Aug 1, 2026
Merged

ndokter merged 1 commit into
ndokter:masterfrom
brambo123:patch-1

Conversation

@brambo123

Copy link
Copy Markdown
Contributor

While I was testing other things, I noticed that the SocketReader.read() function stopped outputting data when the network connection was lost.
It also causes 100% CPU load through an infinite for loop.

socket.read() returns a packet of 0 bytes if the connection is lost and will not raise an error.
A simple length check ensures that the closed connection is detected.

@ndokter
ndokter merged commit 9767188 into ndokter:master Aug 1, 2026
5 checks passed
@ndokter

ndokter commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix! Ill make a new release

@brambo123
brambo123 deleted the patch-1 branch August 1, 2026 12:46
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