Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^6: Timeout for an established connection

by 0day (Sexton)
on Jan 02, 2013 at 20:50 UTC ( #1011342=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Timeout for an established connection
in thread Timeout for an established connection

Some more code:

socket (my $sock, PF_INET, SOCK_STREAM, getprotobyname('tcp')) || die +"socket: $!"; if(fcntl ($sock, F_SETFL, O_NONBLOCK)){ my $iaddr = inet_aton(${$sock}->{host}) or return; my $paddr = sockaddr_in( ${$sock}->{port}, $iaddr ) or return; setsockopt($sock, SOL_SOCKET, SO_SNDTIMEO, pack("QQ", ${$sock}->{t +imeout}, 0)) or die "setsockopt SOL_SOCKET, SO_SNDTIMEO: $!\n"; setsockopt($sock, SOL_SOCKET, SO_RCVTIMEO, pack("QQ", ${$sock}->{t +imeout}, 0)) or die "setsockopt SOL_SOCKET, SO_RCVTIMEO: $!\n"; setsockopt($sock, 6, 18, pack("QQ", 5, 0)) or die "setsockopt SOL_ +TCP, TCP USER TIMEOUT: $!\n";


Comment on Re^6: Timeout for an established connection
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011342]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-07-11 04:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (218 votes), past polls