Connection failed: the semaphore timeout has expired

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Ado64
Posts: 18
Joined: August 5th, 2018, 2:29 pm

Connection failed: the semaphore timeout has expired

Post by Ado64 »

Hi guys, I have some issue with the subject message. On multiplayer when I create a new game and I wait for somebody join, if I wait more than about ten minutes then it's like my host gets disconnected. I don't get this error message at once, so I can continue to wait for somebody but I'll no more be able to see any update on my game room, and when I go back to the lobby I get this message and I get disconnected. The weird thing is that once I try to get again into the lobby the server tell me that my nick is still on so my new login will disconnect him.
The same thing happens also when I play some multiplayer scenario and somebody go away for a while, if nobody makes some move for about ten minutes then I'll not be able to see any progress on the game and when I go back to the lobby I got the same bad message :/

I'm struggling with this from a long time. I tried to:

- uninstall my antivirus
- shutdown any local firewall
- open port 15000 on my router on both directions
- update driver of my network card
- use a cabled connection instead of a WiFi one
- update bfw to the latest version
- change pc


and now, exhausted, I'm here for this last attempt hoping somebody else already experienced the same issue... I'm using windows 7 and latest version of the game, and I always use the forum account to login into the lobby.

Thanks in advance
User avatar
Pentarctagon
Project Manager
Posts: 5528
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Connection failed: the semaphore timeout has expired

Post by Pentarctagon »

This sounds like a Windows problem, ie: 1 2
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Ado64
Posts: 18
Joined: August 5th, 2018, 2:29 pm

Re: Connection failed: the semaphore timeout has expired

Post by Ado64 »

I don't really know, the second pc I tried has Windows 10, I got this message from both and only playing bfw...
Ado64
Posts: 18
Joined: August 5th, 2018, 2:29 pm

Re: Connection failed: the semaphore timeout has expired

Post by Ado64 »

I think It is something related with the heartbeat ping that the server is waiting from my bfw client but for some reason in some circumstance (the ones I wrote above) it doesn't sent it up.
I tried to open port 15000 on my router, is there maybe another port involved in this mechanism?

Thanks
Ado64
Posts: 18
Joined: August 5th, 2018, 2:29 pm

Re: Connection failed: the semaphore timeout has expired

Post by Ado64 »

Nobody that can help?
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Connection failed: the semaphore timeout has expired

Post by Tad_Carlucci »

I just looked, again, at the links from Penarctagon. You have you answer: it's a Windows issue. You don't give enough information for more assistance.
I forked real life and now I'm getting merge conflicts.
Ado64
Posts: 18
Joined: August 5th, 2018, 2:29 pm

Re: Connection failed: the semaphore timeout has expired

Post by Ado64 »

Tad_Carlucci wrote: January 3rd, 2019, 10:40 am I just looked, again, at the links from Penarctagon. You have you answer: it's a Windows issue. You don't give enough information for more assistance.
I tried two different laptops from my home connection, the first one had win7, the other one win10 and I got this problem from both. I had a look on those links but it seems to be another issue, maybe related to the file system but anyway related with Windows Update, I caught this issue playing btw only. I can say that all my windows machines are genuine and updated to the latest build, which other information would you like to know? I'm available to provide any additional thing that can help

Thanks
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Connection failed: the semaphore timeout has expired

Post by Tad_Carlucci »

My first suggestion would be to go to another network. School, library, cafe, a friend's house (in a different neighborhood). You tried two systems but not a different network. If that's not feasible, check your router and modem are properly configured, power down everything, wait five minutes, power up and try again.
I forked real life and now I'm getting merge conflicts.
gnombat
Posts: 682
Joined: June 10th, 2010, 8:49 pm

Re: Connection failed: the semaphore timeout has expired

Post by gnombat »

I'm not really an expert in networking (or multiplayer Wesnoth), but isn't it fairly common for networks (especially NAT-based networks) to have a timeout for idle connections?

https://fastmail.blog/2013/05/28/push-e ... ice-sleep/
...some of our users are behind NAT gateways/stateful firewalls that have short state timeouts. If you leave a TCP connection idle for too long (variable from 2 to 30 minutes depending on the device), these start dropping any new packets on the connection.
Ado64
Posts: 18
Joined: August 5th, 2018, 2:29 pm

Re: Connection failed: the semaphore timeout has expired

Post by Ado64 »

Unfortunately I got the same issue from another connection too (my mobile connection). At this point I can only give up... :(
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Connection failed: the semaphore timeout has expired

Post by josteph »

There are a few remaining possibilities. It's possible that you're running into two separate problems, such as your ISP and your mobile provider both dropping the connection independently, but it's more likely that all your problems have a single cause. For example, perhaps there's some program that's installed on both of the computers you tried this on, that causes the problem.

At this point, I would recommend to try and find some setup that works. For example, ask a friend to install wesnoth on their laptop, enter the multiplayer lobby, and idle there. Once you find a setup that doesn't have the problem, start reducing the differences between the two setups (get them to bring their laptop to your house, or vice-versa) until you identify the faulty component.
gnombat
Posts: 682
Joined: June 10th, 2010, 8:49 pm

Re: Connection failed: the semaphore timeout has expired

Post by gnombat »

I was able to reproduce this on my machine/network: I created a game on the multiplayer server, waited 5 minutes, then cancelled the game, then when I tried creating another game I got the message "Connection failed: The semaphore timeout period has expired".

(Note: I chose 5 minutes because I happen to know that is the timeout for idle connections on my network.)
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Connection failed: the semaphore timeout has expired

Post by josteph »

Could we turn just on SO_KEEPALIVE on the server side?
gnombat
Posts: 682
Joined: June 10th, 2010, 8:49 pm

Re: Connection failed: the semaphore timeout has expired

Post by gnombat »

josteph wrote: January 4th, 2019, 5:54 pm Could we turn just on SO_KEEPALIVE on the server side?
One problem with doing it on the server side is that each client might have a different idle timeout, so whatever you set the keepalive interval to, there might be a client with a timeout which is too short for it to work. (I suppose if you were to choose a small value, say, 90 seconds, that might work for all clients you are likely to encounter in the real world.)
Post Reply