-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Socket::available Causes Connection Reset by Peer on Windows UDP Sockets #4537
Comments
Should we be using Maybe not. Looks like that only supports connecting locally. |
I ended up closing and reopening the socket if there was an error after calling |
Some additional testing resulted in |
Describe the bug
Created a DatagramSocket with local address 127.0.0.1:0 and remote address 127.0.0.1:2345. After calling
sendBytes
on this UDP socket,poll
returns true, thenavailable
returns -1 and the last error is "connection reset by peer". I suspect this is from therecvfrom
call withinavailable
. If I change this to use the IP of a remote machine as the remote address, poll properly times out and returns false aftersendBytes
.To Reproduce
Expected behavior
Poll returns false, just like it would when local and remote IPs don't match.
Please add relevant environment information:
The text was updated successfully, but these errors were encountered: