Re: Help improving IO::Socket script response



Marc Bissonnette <dragnet\_@_/internalysis.com> wrote:
Hi all;

I'm not sure where/what I've gone wrong here; The purpose of the code
below is to get the server type (Apache/IIS/etc) from a list of URLs.
In the SQL query (whose results are used in the IO::Socket call), the
data from 'cname' will be a string, like "Foo Internet", the data from
'mainurl' will be a url like "www.foo.com"

The problem lies in massive time-outs (I don't know what the longest
is/can be: I've killed the process after ten minutes, however);

If you had time-outs, you wouldn't have to kill the process, it would
kill itself (or the connection). It seems to me the problem is that you
*don't* have timeouts, rather you have long periods of blocking. But
where is the blocking taking place, upon connecting the socket or upon
reading from it?

The only
sanity-saving option so far is to run it in batches of ten URLs, but I've
got a list of ~400 to go through.

If the long blocking is in the reads, see IO::Select.
Or just use LWP::Parallel and let it handle all of that stuff.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: error C00D11B3
    ... NIS was blocking the connection. ... LiveUpdates somehow changes these settings? ...
    (microsoft.public.windowsmedia.player)
  • Re: Bicycle riders will get more respect once they start obeying the laws that govern them.
    ... They are blocking in connection with the protest now, ... drain giants later. ...
    (rec.music.christian)
  • RE: Non-Blocking UDP in VB.NET for beginners?
    ... I believe I have worked out for myself how to get around the blocking ... But to test the connection I attempt to get the ... Dim ReceivedEx As String ...
    (microsoft.public.dotnet.languages.vb)
  • Re: New Proxy SITES
    ... all the logs will show is a connection to an address down Mexico way.. ... Well, I feel when it comes to blocking CHRISTMAS music, I consider any ... spam999free@xxxxxxxxxx (remove 999 for proper email address) ...
    (comp.security.firewalls)
  • Re: [PATCH] oom killer (Core)
    ... > Further we need a better selection of whom to kill. ... I added a callback which is called from do_exitwhen the ... The reentrancy blocking is released inside the ... Interesting is that the patch applied to the current code in 2.6.10-rc2- ...
    (Linux-Kernel)