Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Timeout for an established connection

by 0day (Sexton)
on Jan 01, 2013 at 12:14 UTC ( #1011147=note: print w/ replies, xml ) Need Help??


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

Ok.
There is a spider that walks the http links. Spider has a limited number of connections, let it be 10.
If we run this spider and he will eat 10 such references (http://stockzooi.com/), then it stops working.
Because IO::Poll, as well as IO::Selekt not notified about the data recv.

Connection occurs. The data is sent. No response from the server.

On my computer, the browser tries to open this site 24 hours.
If the connections is the only one we can close it when the IO::Poll returns zero (timeout).
But this did not happen, because the remaining 9 connections will be processed normally. Soon the spider will eat one same link. Working connections will remain 8.
Etc.


Comment on Re^2: Timeout for an established connection
Re^3: Timeout for an established connection
by BrowserUk (Pope) on Jan 01, 2013 at 18:53 UTC

    Okay, that explains the problem you are trying to deal with. Ie: when a server accepts a request ($svr->send( GET ... )), but never actually responds.

    By default, the connection will remain open for something like 900 seconds. The solution is to use setsockopt() to set the TCP_USER_TIMEOUT.

    A search for that term will turn up the relevant docs.


    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.
      Thanks... but, unfortunately I did not find this flag in perl modules.
        I did not find this flag in perl modules.

        Look up the appropriate numeric value in your C-runtime header files and use that.


        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-07-11 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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








    Results (221 votes), past polls