What OS are you using?
It looks like all linux kernels since 2.6.32 has implemented TCP_USER_TIMEOUT; which would definitely be the better option if it is available to you.
This is something I have long done.
Hm. Makes me wonder why you are asking here, if you already have a solution?
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [Watch: Dir/Any] |
>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.
| [reply] [Watch: Dir/Any] |
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 ) )
Or possibly: my $userTimeout = 5000;
setsockopt( $sock, 6, 18, \$userTimeout );
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [Watch: Dir/Any] [d/l] [select] |