You just need to set SO_REUSEADDR on the web server's control socket before
binding it.
This setting allows you to re-bind an address that is in a wait state (the
connection still has packets in transit, or at least it thinks it might, so
the OS has not yet relinquished the resource).
The MUD's normal control socket has this option set, so you can look in
comm.c for an example.

--Palrich.

----- Original Message ----- 
From: "Dale Kingston" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, June 04, 2003 1:21 AM
Subject: Binding a port


> Been having a problem with our webserver and I was wondering if anyone
knew
> how to unbind a port... The problem is when the mud fires up the webserver
> it binds port 5001. Now if we crash/copyover and someone has a pending
> request from the webserver. When the startup script tries to bring that
mud
> back up it can't bind port 5001 cause it's already being used and so the
mud
> exits and tries again till what ever is keeping the port bound unbinds
it...
> Does anyone know how I could have it unbind the port? I have had it so
when
> theres 1 min left in a coyover it will shut down the webserver, and that
has
> helped but we've still had times where it's done that and it won't come
> backup cause that port is still being bound.....
>
>
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom


Reply via email to