Re: Win32::Internet fetch url question



EL34 wrote:

Please stop top-posting....

J. Gleixner wrote:
EL34 wrote:
[...]
I am using fetch to open the file.

Next time, show the code that creates $INET.


Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated.
Maybe you should look through the documentation for Win32::Internet,
instead. :-)

I've never used it, however I took a few seconds and searched the
documentation for 'timeout', and found a 'ConnectTimeout' method. That
should provide you with a solution.


> EL34 wrote:
>> Thanks, but that one line does it all, there is no other code exept
>> Use::win32::internet.

Well, there's your problem.

>>
>> I was kind of looking for someone who was familiar with the module and
>> an example, as I stated above.

It seems to be clearly spelled out in the documentation, I don't
need to be familiar with the particular module, if it's well
documented.

>> Please don't get Po'd but your answer was of no help.

Why would I be "Po'd" that I point you right to the method you
need to resolve your stated issue and you say I was no help?

> Use::win32::internet.
use Win32::Internet;

See, this stuff is important. If that's wrong then the one
line from you're script doesn't help anyone figure out
the problem.

> $INET = new Win32::Internet();
> $INET->FetchURL("$FileOnServer");
>
> Actually, here's all that's required to fetch an URL.
> Anyone have a simple working example of using the http session seesion
> code and a way to test if the page can be fetched?
> I'm not sure what I am looking at in the doc's as I stated above.

So you looked at the documentation and found ConnectionTimeout and that didn't help disconnect the connection after a certain amount of time waiting? I don't see that in your code.

You could also look at the test code that comes with that module,
which I found conveniently located on CPAN.

http://search.cpan.org/src/JDB/libwin32-0.26/Internet/test.pl

The "GENERIC URL FETCHER" part...

It's amazing the helpful things you find in the documentation.. :-)

Now, if you come back for more, after that, and top-post your 3-line script saying "It didn't work", then I'll get "Po'd".

Thank You
.



Relevant Pages

  • Re: Inserting connection
    ... If it's a PPC Phone Edition device it will support the Xml configuration ... connection type - GSM/GPRS etc for example for GPRS you might have something ... See the topic - creating a CAB provisioning Format (.cpf) File in the SDK ... documentation for details on how to build this into a cpf which you can tap ...
    (microsoft.public.dotnet.framework.compactframework)
  • Bad winsock behavior with SynAttackProtect and listen backlog exceeded
    ... "The listen function is typically used by servers that can have more than one connection ... RESET back from the server immediately after the 3-way handshake (SYN, SYN-ACK, ACK). ... documentation. ...
    (microsoft.public.win32.programmer.networks)
  • Re: When does IsReusable Property get interrogated?
    ... a transaction handler is released to the pool. ... class, which opens a DB connection, and provides the Databroker to its ... I haven't found the documentation to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: lookingheart ........
    ... connection between the two spheres in this case. ... and the NRMT have been pointed out and documented ... documentation supporting the exsistance of the mythical nrmt ... ...
    (alt.gathering.rainbow)
  • Re: No wonder Borland Technical Documentation stinks
    ... DevCo can vette books for a DevCo Press ... Or make it a joint responsibility of documentation and ... writers and R&D team, so the writers become a part of the scrum. ... unit and integration test code into the product's documentation. ...
    (borland.public.delphi.non-technical)