News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Why do i get so many "is not a socket" responses?

Started by FLN, March 01, 2025, 04:49:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FLN

When trying to join a server-game I most often only get this response, along the lines of:
 "The operation referred to an object that is not a socket."

Why is this, and what are probable causes?

Before trying to join I made sure to run the right Simutrans version and pakset, corresponding to the details on the server listing.
Are there other things I have to watch out for?

Thank you for your help.

ceeac

Please post the exact steps to reproduce and the exact error message. Are you trying to connect to the server via IPv4 or IPv6? Which server are you trying to connect to? Does this happen always or only sometimes? Can you post your simu.log when simutrans is started using "-debug 3 -log"?

prissi

#2
This is an internal error message, on WIndows code 10038 https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
QuoteAn operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.

I assume your OS is windows? Then this error could happen on deselecting an invalid socket as we tried to implement non-blocking socket on windows with limited success.

Did you get this when connecting to the server list, to the actual server or when querying some server on that list?

FLN

Quote from: ceeac on March 02, 2025, 09:30:39 AMPlease post the exact steps to reproduce and the exact error message. Are you trying to connect to the server via IPv4 or IPv6? Which server are you trying to connect to? Does this happen always or only sometimes? Can you post your simu.log when simutrans is started using "-debug 3 -log"?
Hi ceeac,

  • I don't know through which IPv I'm actually connecting. In my PC's network properties I find addresses for both standards... How can I find out, which will be used when trying to connect to a Simutrans server game?

  • I just now tried to join the server shown in the "Server list entry"-screenshot below.

  • The "object is not a socket" response I get like 50% of the time and usually concerns always the same servers.

  • I was able to lunch Simutrans with the "-debug 3"-command and share the log file here.
    (could not add the file to this post, as it's just 40kB to big lol)
    Allow me to present an possibly relevant extract of the log:

    Message: network_open_address(): Preparing to bind address: ::
    Message: network_open_address(): Potential local address: ::
    Message: network_open_address(): Potential remote address: 2a01:41e3:2373:bc00:1c75:7a9f:e63e:1cb9
    Message: network_open_address(): Could not connect FD_ISSET failed.
    Message: network_open_address(): Preparing to bind address: 0.0.0.0
    Message: network_open_address(): Potential local address: 0.0.0.0
    Message: network_open_address(): Potential remote address: 2a01:41e3:2373:bc00:1c75:7a9f:e63e:1cb9
    Warning: network_gameinfo: Ein Vorgang bezog sich auf ein Objekt, das kein Socket ist.


FLN

Quote from: prissi on March 03, 2025, 05:38:51 AMI assume your OS is windows?
Hi prissi,
your right with the assumption, I'm using a Windows OS. It's a up-to-date Windows 11 Home version, to be more specific.

Quote from: prissi on March 03, 2025, 05:38:51 AMDid you get this when connecting to the server list, to the actual server or when querying some server on that list?
I'm not 100% sure I understand exactly what you mean, so I just try to briefly describe how I proceed, wehen trying to connect:
I first look up the online server games in the official server listing.
In the details I check which Simu release and what pak version the server is running and lunch the matching Simu installation on my laptop.
After choosing "play online" in the menu, usually the targeted server game is allready listed in the dialog and I simply proceed by selecting it and confirming via the "play online" button.
If the "... is not a socket"-response prompts I press the button again, repating this same resault 4 or 5 times, as with other error-prompts repeating the connection attempt often helps.

prissi

This message is generated when there is a timeout (select() returns 0) because the host is not reachable.

This would happen if the server stopped responding between the last announcement (and not overdue) and your query. In this particular case, the error string was zero even though connection failed. Need more analysis though.

ceeac

Quote from: FLN on March 03, 2025, 09:36:31 PMHow can I find out, which will be used when trying to connect to a Simutrans server game?
According to the log the connection is attempted first using IPv4 and then using IPv6.

If the remote server is busy uploading the map to a different client, or just slow to respond (>= 2 seconds), the first connection attempt (using IPv4) is aborted and the socket is closed. The next connection attempt (using IPv6) is then done with an invalid (since closed) socket.

prissi

Thank you, that was indeed a stupid error. Fixed in r11652