Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011342]
[Corion]: Heh. The JSON link for Strawberry releases gives me the idea that I should provide an RSS proxy so people can get notified when a new release is there...
[Corion]: In other RSS news, I've updated my photo stream with images from Lanzarote
[choroba]: Corion Nice
[Corion]: Hi choroba! I'm somewhat fond of this picture - I think it is Breaking Bad-style even though I haven't watched the series at all ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-02-27 08:27 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (377 votes). Check out past polls.