I have an old multiplayer game server, and hackers can crash the game server via telnet. That's not the problem. When I run the game server on a specific TCP port, and intentionally crash the server myself, the game server exits, and reopens (by design), however, the server cannot seem to listen on the port again (nothing listening) until about 1 min passes. I can close the game server and reopen it but it does listen on the port until the minute passes.
Is there anything with WineHQ I can kill, or do to solve this problem?
Thank you.
Can't reopen server port after crash
Re: Can't reopen server port after crash
@vspin
They may be a delay in tearing down the currently running wineserver process.
Take a look at the parameters for wineserver:
Code: Select all
wineserver --help
Usage: /usr/lib/wine-vanilla-6.0_rc3/bin/wineserver [options]
Options:
-d[n], --debug[=n] set debug level to n or +1 if n not specified
-f, --foreground remain in the foreground for debugging
-h, --help display this help message
-k[n], --kill[=n] kill the current wineserver, optionally with signal n
-p[n], --persistent[=n] make server persistent, optionally for n seconds
-v, --version display version information and exit
-w, --wait wait until the current wineserver terminates
The persistent and foreground options might also be of use to you.
Good luck!
Bob
Re: Can't reopen server port after crash
Thank you much for your time. I think I figured out the problem here: viewtopic.php?f=8&t=22758. Client sockets are in TIME_WAIT, and timeout in 60 seconds.
Because I don't have the game server's source code, I cannot make the necessary changes in the code to make it work as desired. I found two utilities that say they can kill connections on a port in TIME_WAIT: tcpkill and killcx. I'm checking them out now..
Re: Can't reopen server port after crash
I may be wrong. When I run the following command to check for sockets in TIME_WAIT state, I get no results:
netstat -n|grep TIMED_WAIT|grep 1849
netstat -n|grep TIMED_WAIT|grep 1849
Re: Can't reopen server port after crash
Nevermind, I was wrong. The socket does remain in TIME_WAIT state for 60 seconds. I'm going to give the following utility a try, and see if I can get it to kill all the connections.
https://github.com/arut/linux-tcp-drop
https://github.com/arut/linux-tcp-drop
Re: Can't reopen server port after crash
I was able to successfully kill all tcp sockets in TIME_WAIT state using https://github.com/milabs/drop-tcp-sock with the command below. Now everything is working.
netstat -t -n | grep [port] | awk '{print $4"\t"$5}' >/proc/net/tcpdropsock
netstat -t -n | grep [port] | awk '{print $4"\t"$5}' >/proc/net/tcpdropsock
Re: Can't reopen server port after crash
Nice catch! That's a useful kernel module.vspin wrote: ↑Thu Dec 31, 2020 7:13 pm I was able to successfully kill all tcp sockets in TIME_WAIT state using https://github.com/milabs/drop-tcp-sock with the command below. Now everything is working.
Code: Select all
netstat -t -n | grep [port] | awk '{print $4"\t"$5}' >/proc/net/tcpdropsock
Bob