Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows specific crash bug where WSAECONNRESET can occur randomly with UDP sockets client/host #66

Closed
silbinarywolf opened this issue Jul 8, 2023 · 0 comments · Fixed by #67

Comments

@silbinarywolf
Copy link
Contributor

silbinarywolf commented Jul 8, 2023

What's the issue?

I have both a server and client using UDP, both sending and receiving from each other.

When calling receive on a UDP socket where there's a random chance that it'll fail with an WSAECONNRESET error (currently not catchable as it's unreachable code).

A fix I know currently works:

  • Updating recvfrom error handling to catch WSAECONNRESET like so:
.WSAECONNRESET => error.ConnectionResetByPeer,
  • Catching that kind of error when calling sock.receive and ignoring it.

How various libraries avoid this issue:

Various other sources talking about this issue:

@silbinarywolf silbinarywolf changed the title Fix Windows specific bug where WSAECONNRESET can occur randomly with UDP sockets client/host Fix Windows specific crash bug where WSAECONNRESET can occur randomly with UDP sockets client/host Jul 8, 2023
@silbinarywolf silbinarywolf changed the title Fix Windows specific crash bug where WSAECONNRESET can occur randomly with UDP sockets client/host Windows specific crash bug where WSAECONNRESET can occur randomly with UDP sockets client/host Jul 8, 2023
@ikskuh ikskuh closed this as completed in #67 Jul 9, 2023
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 a pull request may close this issue.

1 participant