I have a game server running on my CentOS box that binds to port 28960, now when I restarted the game server it stated that it can't bind the port because its in use, but its obviously because the server was restarted, but the port was not closed? How do I check to see if the program is listening, and if its not, then how would I clear the port, so I can start the server back up on port 28960?
I think you may be running into the 2*MSL problem. Here's how you tell:
If you get anything back from that, it means the kernel's network stack is waiting for twice the maximum segment lifetime (MSL) for stray packets to get around to making an appearance before allowing that port to be re-bound. The
Servers that are intended to be restarted in normal operation disable
If not, and you can't get the source to modify the game server, your only option is to wait for the
Here is a script I call
You just run it and wait for it to stop putting out lines every second. Then you Ctrl-C it and move on with whatever you needed to do that required that there be no wait states.
This script isn't suitable for use on a busy server, where there are wait states going on all the time, but when you're just waiting for a server with nothing else going on to achieve quiescence, it's perfect.
You could try