For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > March 2005 > Can't get new listener after I stop my script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can't get new listener after I stop my script
not entered

2005-03-30, 8:57 pm

I've got a perl script running on a linux box. The script uses a socket
server and when I stop the script and restart it, I can't get a listener for
about 5 minutes. The line that I'm using to get the listener is:

$manager = new IO::Socket::INET ( Listen => 5, LocalPort => 1099);

SOMETIMES I can get a new listener right away... most of the time it takes
about 5 minutes... occasionally it takes 10 or 20 mins.

Does anyone know what's happening? Should I be stopping the script more
gracefully?

Stephen.


A. Sinan Unur

2005-03-31, 3:58 am

"not entered" <someone@microsoft.com> wrote in
news:_bH2e.14196$w63.911534@news20.bellglobal.com:

> I've got a perl script running on a linux box. The script uses a
> socket server and when I stop the script and restart it, I can't get a
> listener for about 5 minutes. The line that I'm using to get the
> listener is:
>
> $manager = new IO::Socket::INET ( Listen => 5, LocalPort => 1099);
>
> SOMETIMES I can get a new listener right away... most of the time it
> takes about 5 minutes... occasionally it takes 10 or 20 mins.
>
> Does anyone know what's happening? Should I be stopping the script
> more gracefully?


http://unlser1.unl.csi.cuny.edu/faq...nix-socket-faq-
4.html

See

ReuseAddr Set SO_REUSEADDR before binding

in

<URL: http://search.cpan.org/~nwclark/perl-
5.8.6/ext/IO/lib/IO/Socket/INET.pm>

Sinan


--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/c...guidelines.html
Tad McClellan

2005-03-31, 3:58 am

not entered <someone@microsoft.com> wrote:
^^^^^^^^^^^^^^^^^^^^^

[snip]


Please consider using a non-defaulted posting address.

There have been plenty of idiots posting with that address,
you don't want to be associated with them I would guess.

More people will see your posts if you choose some other address.


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com