SPUG: Closing HTTP::Daemon port

Marc M. Adkins Marc.M.Adkins at Doorways.org
Tue Aug 12 00:46:15 CDT 2003


> Can you post your code so we can play with it?  Or at least a minimum
> working example of something that will cause your issue.  If I can
> replicate it I might be able to figure out how to fix the issue...

OK, here's a stripped-down version.  It demonstrates the behavior on
Mandrake 9.1.

Create two terminals.  Run testsvr.pl in one.  Wait until it says "Server
Created."  Run testsvr.pl in the other.  It should shut down the first one
and run in the second one.  Repeat as necessary.  Fun, huh?

On Windows this happens immediately (more or less).  On Linux it takes 55-60
seconds.  There's a counter in the code to keep you company.

Since my last post I opened up LWP::Simple and swiped the 'trivial' function
for testing purposes.  Didn't change the behavior.  While it was in I did
notice that there was a 60 second timeout on the connection to the server
for the /quit command.  I changed this to 30 seconds and it didn't affect
anything.  So I removed that code and went back to LWP::Simple.

I previously said that the behavior didn't happen if I used <ctrl-C> to
interrupt the original server.  That is not in fact the case (or at least I
can't duplicate that feature now).  If I <ctrl-C> the first server and
_then_ start the second it _still_ takes almost a minute.

The sleep 1 at the top of the wait loop is necessary on Windows but not on
Linux.  It doesn't affect the behavor on Linux, it just isn't necessary.

mma
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testsvr.pl
Type: application/octet-stream
Size: 4669 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030811/c0570cd6/testsvr.obj


More information about the spug-list mailing list