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

PacketPeerUDP.listen reuses port without error on Linux #43912

Closed
neauangle opened this issue Nov 27, 2020 · 2 comments · Fixed by #43918
Closed

PacketPeerUDP.listen reuses port without error on Linux #43912

neauangle opened this issue Nov 27, 2020 · 2 comments · Fixed by #43918

Comments

@neauangle
Copy link

neauangle commented Nov 27, 2020

Godot version:
Godot 3.2.2.

OS/device including version:

Tested on an Ubuntu 20.04 virtual machine inside VirtualBox.

Issue description:
Calling listen with the same port number sequentially on two PacketPeerUDP instances should fail with error code 2. This happens on Windows, but on Linux it succeeds. You can even see there's two identical entries here:

Screenshot_1

Steps to reproduce:
Create two PacketPeerUDP instances and call listen on the same port. Can someone see if they can duplicate this issue? I'm not 100% confident posting an issue based on results on a virtual machine. It's using a bridged networking adapter, for what that's worth.

Minimal reproduction project:

New Game Project.zip

@Calinou
Copy link
Member

Calinou commented Nov 27, 2020

cc @Faless

@Faless
Copy link
Collaborator

Faless commented Nov 27, 2020

The problem is that we enable SO_REUSEADDR which behaves differently between windows and linux (and is thus disabled on Windows).
I guess this is a bug, and SO_REUSEADDR should NOT be used for UDP.
I'll make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants