Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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: (4)
As of 2015-07-06 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls