Closed DavidCo113 closed 1 year ago
it appears i need to unbind it, maybe i should actually get it working before making more pulls next time lol
The issue with the lan servers is not because of the actual networking, but because of a multi-threading race-condition. Basically the ping thread accesses a pointer to early, before it is set.
Now about the proposed patch in this PR: looking at the errno
value after enet_socket_bind
is called, the internal bind
call it runs on Linux always fails with "Invalid argument", resulting in enet_socket_send
to never be executed. Thus the client will never receive answers from any lan server (because it did not send a request in the first place) and the faulty code resulting in the crash is never run.
Also we do not want to ever bind this socket, because it actually needs to receive answers from multiple ports.
I changed one function to another function this time. (
enet_socket_connect()
toenet_socket_bind()
)