Error:
java.net.SocketException: getsockopt (connection refused / reset / timed out)
A low-level socket failure between your PC and the server. Same family of problems as Connection Reset - treat it as a network/connectivity issue first.
Try this first
- Confirm the server is online (servers list / Discord).
- Restart Minecraft, then router (30s unplug), then PC.
- Flush DNS.
- Disable VPN/proxy and retry.
Common fixes
- Firewall: allow Java and your launcher (Private + Public).
- Antivirus: temporary disable to test; add exceptions if that fixes it.
- DNS: use
1.1.1.1/1.0.0.1or8.8.8.8/8.8.4.4, then flush DNS. - Network stack (Windows, Admin CMD, then reboot):
netsh winsock reset netsh int ip reset ipconfig /flushdns - Different network: try Ethernet vs Wi-Fi, or a phone hotspot, to see if your ISP/router is the problem.
Joining a public server: you usually do not need to port-forward 25565. Port forwarding is for hosting, not connecting.
Still stuck?
Same info as Connection Reset helps: error text, latest.log, pack version, and whether other online games work. discord.gg/mmcn
Related: Connection Reset · Flush DNS