My Fix for “Connection timed out: getsockopt” in Minecraft LAN Games

Minecraft LAN game getsockopt error

My two sons wanted to play Minecraft together on their laptops. One of them started a world (we're on Forge 1.20.1) and opened it to LAN. The other one could actually see the world listed under “Scanning for games on your local network”, but every time he tried to join, it would just fail.

I tried the following but these did NOT work for me:

The weird part was that the world showed up in the list, but we couldn't connect to it. Turns out those are two different things. The host laptop sends out a broadcast saying “hey, I'm hosting a world here”, and that's outgoing traffic, so it gets through just fine. But joining the world means the other laptop has to connect into the host laptop, and that incoming traffic was being blocked.

In my case, the culprit was Windows Firewall on the host laptop. These are the steps I took to fix it, all on the laptop hosting the world:

The Java rules were probably the main issue. When you first open a world to LAN, Windows pops up a firewall prompt. If that gets dismissed (or a kid clicks Cancel 😅), Windows quietly creates rules that block Java, and you never see the prompt again.

After the two fixes listed above, I restarted Minecraft on my younger son's laptop and got the Windows Firewall prompt for Java to allow incoming connections. I clicked allow. After that, my son was able to join his brother's world and they were off building together.

That also explains why it only worked one way. My older son's laptop had probably been set up to allow the connection at some point, but my younger son's laptop never was, so it was the first time anyone tried to connect into it.

Side note: the ping failing didn't really mean anything. Windows blocks ping by default, so don't rely on it to test your connection.

Hope this post helps someone else. Happy gaming!

Tags: #Minecraft #Fix

Reply via email... or leave me a comment below.