The big lag on Wormux game server is finally fixed!
Yes, I'm sure
This time, it is not 2 o' clock in the night like 2 days ago, I have really tested the fix.
Wormux players with technical background in computer science may be curious about the reason of the lag. After having suspected TCP flags, I have looked closely at the game server code...
The game server is composed of only one thread. This thread after initialization runs one infinite loop. During the loop,
1. it receives/sends a keep alive message to the index server (for the game server to stay visible in the list of public games),
2. it checks for new clients
3. it checks new messages from connected clients and forwards these messages to the others clients (only those who are playing in the same game of course)
The problem was in the first step of the loop, explaining that when we have tried the game server, without connexion to index server, it was working good. In the step 1, there was a timeout about 100ms to wait for receiving a message... The presence of a keep alive message is now checked without waiting.
And the lag is fixed
Yes, I'm sure
This time, it is not 2 o' clock in the night like 2 days ago, I have really tested the fix.Wormux players with technical background in computer science may be curious about the reason of the lag. After having suspected TCP flags, I have looked closely at the game server code...
The game server is composed of only one thread. This thread after initialization runs one infinite loop. During the loop,
1. it receives/sends a keep alive message to the index server (for the game server to stay visible in the list of public games),
2. it checks for new clients
3. it checks new messages from connected clients and forwards these messages to the others clients (only those who are playing in the same game of course)
The problem was in the first step of the loop, explaining that when we have tried the game server, without connexion to index server, it was working good. In the step 1, there was a timeout about 100ms to wait for receiving a message... The presence of a keep alive message is now checked without waiting.
And the lag is fixed
gentildemon
On: 07/22/09

