mas-bandwidth / netcode

Secure client/server connections over UDP
BSD 3-Clause "New" or "Revised" License
2.43k stars 191 forks source link

Fix netcode server to update address property when letting the system assign a port. #94

Closed maxweisel closed 4 years ago

maxweisel commented 4 years ago

At the moment, if you let the system assign a port (by passing port 0), the server->address property will have a port of 0 even after the system has assigned one. This means all incoming connection requests will be rejected because the port does not match.

This PR updates the server->address property to include the system assigned port once the socket is created. Fixes issue https://github.com/networkprotocol/netcode.io/issues/93.