SPUG: Closing HTTP::Daemon port
Marc M. Adkins
Marc.M.Adkins at Doorways.org
Sat Aug 9 07:16:59 CDT 2003
> Are you closing the listener on the socket? Because in order to listen for
> connections, you have a listener on it. (how can you test/tell? that's the
> thing that's always stumped me.. well sure, netstat. doesn't seem to be
> "fast enough" though. I don't trust it.) Are you checking the exit status
> before undeffing? Is there somebody trying to make a connect on
> it when you
> close/undef?
I'm closing the HTTP::Daemon object which is an IO::Socket::INET and
(presumably) the actually listener. I call close() on it then undef it. I
would hope that would be the necessary and sufficient condition for closing
the beast. I would add that I always close the connection objects created
during normal processing, as per the documentation of HTTP::Daemon.
As to someone attempting to make a connection, I suppose that's possible,
though unlikely. Frankly, I don't want that to be an issue, because it's
not controllable from within the server script.
> >If I <ctrl-C> to KILL the program it doesn't seem to hold the port.
>
> That I don't quite understand... does the job otherwise stick
> around as defunct?
I haven't been able to find any. I've been looking.
mma
More information about the spug-list
mailing list