Page 1 of 1

Cannot restart a server

Posted: Sat Jan 22, 2005 4:08 pm
by Azriel
Here is my problem : when i start a server on my machine, and when it crashes, i can't start again the server : it says :

error on setsockopt REUSEADDR: Invalid argument
error on setsockopt REUSEADDR
error on bind command: Address already in use
error on bind command

After, say 10 minutes, i can restart the server. Does anyone know how to avoid this ?

Posted: Sat Jan 22, 2005 8:34 pm
by Leaf
Is the server running on Windows?

What about shutting down the process with the task manager window?


If the server is running on Linux..

1.) From a shell prompt type: ps aux | grep cross

2.) Look at the output for the crossfire process. Example:

504 16142 0.0 0.0 4096 920 pts/1 S Jan12 .crossloop

3.) See the second column? In this case, it's 16142 which is the process ID

4.) Use this command: kill 16142 (basically, kill <process_id>)

5.) Check again to make sure it died nicely, using: ps aux | grep cross

6.) If it's no longer listed, the server has been successfully killed
6a.) If the process is still listed, you may have to use this command: kill -9 <process_id>

This is just one way to stop the server under Linux. :wink:

Posted: Sun Jan 23, 2005 9:35 am
by Azriel
It does'nt work : the only process with cross is "grep cross". It seems everything about crossfire died at the crash, so there is nothing to kill...

Posted: Sun Jan 23, 2005 8:54 pm
by Leaf
How or what command are you using to start the server?

Posted: Sun Jan 23, 2005 10:14 pm
by Azriel
I just type "crossfire" in a xterm. (I have an imac with X11).

what's strange is that after some amount of time, i can restart the server.

NB : even if i kill X11 and restart it, i still can't resart the server before around 5 or 10 minutes. If i type CTRL C to stop the server, i can restart the server if noone was logged on the server, and i can't if someone was logged, even if i quit the client after.

Posted: Mon Jan 24, 2005 8:42 am
by Ryo
I think there exist 'debug' flags in socket code (not necessarily used in crossfire) that prevent a program from using a port which has been used as server port during 10 mins after the program exited.

Sounds like those flags are on, maybe?

Ie it's a system feature, to lock the port for 10m after server crashed.