Failed to close socket! error then crash

I can’t connect to any servers, modded or unmodded. It keeps giving me this string in the beammp launcher

[19/1/2022 22:32:22] [INFO] Launcher version is up to date
[19/1/2022 22:32:22] [INFO] Game Version : 0.24.1.1
[19/1/2022 22:32:22] [WARN] Game is newer than recommended, multiplayer may not work as intended!
[19/1/2022 22:32:22] [WARN] 22 multiplayer mods will be wiped from mods/multiplayer! Close this if you don’t want that!
[19/1/2022 22:32:37] [INFO] Downloading mod please wait…
Progress : [ 100% ] [##########################]
[19/1/2022 22:32:39] [INFO] Download Complete!
[19/1/2022 22:32:39] [INFO] Game Launched!
[19/1/2022 22:32:57] [INFO] Game Connected!
[19/1/2022 22:32:57] [WARN] Game Reconnecting…
[19/1/2022 22:32:58] [INFO] Game Connected!
[19/1/2022 22:33:11] [INFO] Connecting to server
[19/1/2022 22:33:11] [INFO] Connected!
[19/1/2022 22:33:12] [INFO] Checking Resources…
[19/1/2022 22:33:12] [INFO] Syncing…
[19/1/2022 22:34:09] [INFO] Done!
[19/1/2022 22:36:24] [WARN] Failed to close socket!
[19/1/2022 22:36:24] [WARN] Connection still alive terminating
[19/1/2022 22:36:24] [WARN] Failed to close socket!
[19/1/2022 22:36:24] [INFO] Connection Terminated!
[19/1/2022 22:36:24] [WARN] Failed to close socket!
[19/1/2022 22:36:24] [WARN] Failed to close socket!
[19/1/2022 22:36:24] [WARN] Game Reconnecting…

Bumping this because I really need a reply

1 Like

BUMP BUMP BUMP BUMP Please I am having the same issue.

Mine also says error code 10038.

BeamNG.drive 0.24.1.1 0x00000001. This is the code that BeamNG gives me.

1 Like

Hello
Please make sure that beamMP launcher is allowed through windows firewall and in any antivirus you have.
Sometimes this issue also required a restart, the launcher can disconnect or drop connection because of your connecting being blocked, or not securing one in the first place :slight_smile:

I have the same problem but after varying amounts of time after joining a server (between 30 seconds and 5 minutes) and it doesn’t crash, it just boots me back to the menu. This is the string from start (I rejoined 2 times)

[14/7/2022 19:15:03] [INFO] Launcher version is up to date
[14/7/2022 19:15:03] [INFO] Game Version : 0.25.4.0
[14/7/2022 19:15:03] [WARN] Game is newer than recommended, multiplayer may not work as intended!
[14/7/2022 19:15:03] [INFO] Downloading mod please wait…
[14/7/2022 19:15:04] [INFO] Download Complete!
[14/7/2022 19:15:04] [INFO] Game Launched!
[14/7/2022 19:15:11] [INFO] Game Connected!
[14/7/2022 19:15:16] [WARN] Game Reconnecting…
[14/7/2022 19:15:16] [INFO] Game Connected!
[14/7/2022 19:15:28] [INFO] Connecting to server
[14/7/2022 19:15:28] [INFO] Connected!
[14/7/2022 19:15:29] [INFO] Didn’t Receive any mods…
[14/7/2022 19:15:29] [INFO] Done!
[14/7/2022 19:19:37] [WARN] Failed to close socket!
[14/7/2022 19:19:37] [INFO] Connection Terminated!
[14/7/2022 19:21:17] [WARN] Failed to close socket!
[14/7/2022 19:21:17] [WARN] Failed to close socket!
[14/7/2022 19:21:17] [WARN] Game Reconnecting…
[14/7/2022 19:21:17] [ERROR] Client: connect failed! Error code: 10038
[14/7/2022 19:21:17] [INFO] Game Connected!
[14/7/2022 19:21:19] [WARN] Game Reconnecting…
[14/7/2022 19:21:19] [INFO] Game Connected!
[14/7/2022 19:21:29] [INFO] Connecting to server
[14/7/2022 19:21:29] [INFO] Connected!
[14/7/2022 19:21:30] [INFO] Didn’t Receive any mods…
[14/7/2022 19:21:30] [INFO] Done!
[14/7/2022 19:27:56] [WARN] Failed to close socket!
[14/7/2022 19:27:56] [INFO] Connection Terminated!
[14/7/2022 19:28:19] [WARN] Failed to close socket!
[14/7/2022 19:28:19] [WARN] Failed to close socket!
[14/7/2022 19:28:19] [WARN] Failed to close socket!
[14/7/2022 19:28:19] [ERROR] Client: connect failed! Error code: 10038
[14/7/2022 19:28:19] [WARN] Game Reconnecting…
[14/7/2022 19:28:19] [INFO] Game Connected!
[14/7/2022 19:28:21] [WARN] Game Reconnecting…
[14/7/2022 19:28:21] [INFO] Game Connected!
[14/7/2022 19:29:08] [WARN] Game Reconnecting…
At this point I closed the launcher.

I can’t deal with this myself what do I do? This is what whatever this is says (it’s called “Launcher” and it’s a .cfg):

{
“Port”: 4444,
“Build”: “Default”
}

Do I need to change anything? I have only forwarded port 30814.

Thanks.

did you get this ever solved?

I think so. I don’t remember it’s been a while. It might have just been fixed in an update or something.

How to solve ‘‘Disconnect: Socket Close Code 3’’ ?!?

This is a generic message that dictates that a TCP connection was forcibly closed, if there are no other errors it is likely you are experiencing a standard disconnect.

in my personal experience, this warning appears whenever your connection is unstable or too slow. this happens because one’s connection upstream cannot keep up with with the amount of data YOUR game is sending to the server, which is slightly suggestible, BeamMP devs, hmm? now, VERY INTERESTINGLY and IMPORTANTLY, you must remember that this game is non-deterministic, and the AMOUNT of data you send is dependant on the amount of your FRAMERATE. in theory, you can fix all of your sockets problems had you less FPS! obviously, this WOULDNT work if you are already struggling to have more than 60 fps, so then applies the timeout situation in your case, unfortunately. anyway, of course, this is all not necessarily YOUR problem (though YOU can fix it by, for example, physically moving closer to your router if you’re on wifi). had the devs coded a proper netcode, yknow… i have been playing beammp on public wifi networks and i always had this warning. it’s usually harmless and shouldn’t disconnect you, unless you have timed out for way too long. there is a hardcoded timeout kick feature in beammp, which proceeds to kick you when it thinks you lost connection, when in fact something is overwhelming your router bandwidth, such as many connected devices or something, which contributes to the inability of the BeamMP netcode and windows sockets that they decided to go with, to cope with such unusually slow speeds, when it probably expects an excellent fibre optic connection or something lol, and THEN you are getting constant random ping spikes all the time (couldnt be me). though, it only says “you have been disconnected from the server”, this message is pretty vague, but most of the time it means you timed out (as in your connection is so unstable, you have been disconnected) or the server simply shut down, but not to worry – there will be an update regarding this situation. do not confuse with larger pings – as long as you have a stable internet you can enjoy playing with people from the other side of the planet! usually this shouldnt be a problem in online games, but beammp desperately needs a better netcode with more forgiving optimisations for slower connections, or generally, better work with windows sockets (or none at all).

you should also remember that the server ITSELF may have an unstable connection as it sometimes happens with SOME hosting. always double-check on the official servers if it is, indeed, on YOUR end and not your modded servers’!

but here’s the kicker: in BeamMP there is no upload/download client settings, so you cannot limit how much data you are sending AND/OR receiving. maybe one day though! :sweat_smile: