Skip to content

Default ENetMultiplayerPeer disconnecting on LAN #105726

Open
@janavarro95

Description

@janavarro95

Tested versions

-Reproducible in Godot 4.3, 4.4.1.stable, 4.5.dev2

System information

Godot v4.4.1.stable - Windows 10 (build 19045) - Multi-window, 1 monitor - OpenGL 3 (Compatibility) - NVIDIA GeForce GTX 1660 SUPER (NVIDIA; 32.0.15.6590) - Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz (20 threads)

Issue description

When creating a server and client for a multiplayer game, I noticed that when I have the client and server running on two separate computers on the same network (LAN) that after a random amount of seconds the client will disconnect from the server without an error on either the client or server. The only information I have to go off of is the method I connected to multiplayer.peer_disconnected which only tells me the peers id. I do not expect this disconnect to happen as neither a crash happens, an error by Godot is never displayed to the editor, nor is multiplayer.multiplayer_peer.disconnect_peer(id) ever called. The ENetMultiplayerPeer for both client and server are using only ENetMultiplayerPeer.new() and do not change any of the settings once created.

When testing the same server/client code on the same machine (Local Host) this random disconnection never happens.

I've tested it with both the server computer on an Ethernet connection and on a Wi-Fi connection. The client computer is always on a Wi-Fi connection.

In an MRP version I am not sending any RPCs either, just the initial connection from client to server.

Computer 1's specs are as described above
Computer 2's specs are as follows:
Godot v4.4.1.stable - Windows 10 (build 19045) - Multi-window, 1 monitor - OpenGL 3 (Compatibility) - NVIDIA GeForce GTX 1050 with Max-Q Design (NVIDIA; 30.0.15.1169) - Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz (8 threads)

Steps to reproduce

  1. Open the MRP on two separate computers on the same network.
  2. Start the server on one computer using the Start Server button displayed in the main scene of the project. Note the IP address printed to the console.
  3. On the other computer, change the IP address field returned by ENetClient.gd getIPAddressToConnectTo() to the local IP address of the server computer.
  4. Start the client connection using the Start Client (LAN) button displayed in the main scene.
  5. Observe that the client successfully connects to the server in the console logs on both client and server. This may take a few seconds occasionally.
  6. Observe the Godot's console on both client and server for the disconnect message. I never got the connection to last more than 5 minutes and more often than not it disconnected within 1-2 minutes.

Minimal reproduction project (MRP)

simpleserverclient.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions