in reply to
Re^9: Timeout for an established connection
in thread Timeout for an established connection
>What OS are you using?
Debian 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux
Maybe this is an error in the syntax? "setsockopt($sock, 6, 18, pack("QQ", 5, 0))"
>Hm. Makes me wonder why you are asking here, if you already have a solution?
Because this solution does not seem to me the best.
Maybe this is an error in the syntax? setsockopt($sock, 6, 18, pack("QQ", 5, 0))
That does look suspect to me.
According to this (4th post), the parameter is the address of an int containing the timeout in milliseconds. Given you are on a 64-bit build I'd expect to use something like this in Perl:
setsockopt( $sock, 6, 18, pack( "Q", 5000 ) )
my $userTimeout = 5000;
setsockopt( $sock, 6, 18, \$userTimeout );
Use subroutines for code reuse
Master regular expressions
Write my GUIs with Perl
Abandon CGI in favor of some modern web framework
Put my code in modules
Create CPAN distributions
test and document my code as I write it
Write OOP with or without animal help
Finally switch to a modern Perl style
Create a killer application with Perl
Detoxify from Perl and PerlMonks
Choose another language because Perl is dead
Learn to program for mobile devices
Complete my secret world domination project
None, because the road to hell is paved with good intentions
Results (189 votes),