I don't think that it is possible to do within perl so I had to enable
these options:

echo 1 >> /proc/sys/net/ipv4/tcp_tw_reuse
echo 1 >> /proc/sys/net/ipv4/tcp_tw_recycle

-----Original Message-----
From: Jim [mailto:[EMAIL PROTECTED] 
Sent: Saturday, December 04, 2004 8:27 PM
To: Joshua Berry
Cc: [EMAIL PROTECTED]
Subject: RE: Building Network Redundancy into a Perl Client

> I am trying to implement redundancy in a client application 
> that I am writing so that I can have a primary server and a 
> backup server.  The client is tailing a logfile and sends 
> results to a server for processing, at the end of the tail 
> loop it sends data to a function that tries to establish a 
> connection to the primary server and send the data, if that 
> fails then the data is sent to the backup (failover) server.
> The way the function works, if the primary comes back online 
> then it automatically knows and starts sending data back to 
> the primary.
> 
> The only problem with the way this is implemented is that 
> every connection remains for a couple of minutes in the 
> TIME_WAIT stage:
> 
> tcp    0      0 xxx.xxx.xxx.xxx:xxx       xxx.xxx.xxx.xxx:xxx
> TIME_WAIT
> tcp    0      0 xxx.xxx.xxx.xxx:xxx       xxx.xxx.xxx.xxx:xxx
> TIME_WAIT
> 
> Which adds up if I am sending several connections per minute 
> or possibly per second.  My question is, is there a way to 
> bypass the TIME_WAIT stage or at least reduce the time it is 
> in this stage from within the program?  Below is the 
> subroutine and how it is called.  If there is another way of 
> doing this please let me know.

I took a look at socket options ( setsockopt() ) but I don't see anyting
that would change the time_wait timer ,but I didn't look that hard :).
What
OS are you using? You may have tomodify some kernel settings if you are
using UNIX/LINUX. With windows, here are a few links that may help

http://www.winguides.com/registry/display.php/878/

http://www.windowsitpro.com/Web/Article/ArticleID/23276/23276.html




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to