Time -> Cancle

This is a discussion on Time -> Cancle within the PHP Language forums, part of the PHP Programming Forums category; Hello, How I can cancle or jump over to the next if the progress is longer than 1 sec. He ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-28-2003
Sven Dzepina
 
Posts: n/a
Default Time -> Cancle

Hello,

How I can cancle or jump over to the next if the progress is longer than 1
sec.
He must cancle the fsockopen connection if the host is offline...

Here is my Code:

/////////////////////////////////////////////////////////////////////

$s = explode(" ",microtime());

$Starttime = $s[1]+$s[0];



// AUSWERTUNG HIER ANFANG PING & PORT KONTROLLE ==> ANFANG <==

$socket = @fsockopen($IP, $PO, &$errno, &$errstr);

// AUSWERTUNG HIER ENDE PING & PORT KONTROLLE ==> ENDE <==



$t = explode( " ", microtime() );

$Endtime= $t[1] + $t[0];

$finalzeit = number_format( $Endtime-$Starttime, 3);

/////////////////////////////////////////////////////////////////////


Reply With Quote
  #2 (permalink)  
Old 10-28-2003
Alan Little
 
Posts: n/a
Default Re: Time -> Cancle

Carved in mystic runes upon the very living rock, the last words of Sven
Dzepina of comp.lang.php make plain:

> How I can cancle or jump over to the next if the progress is longer
> than 1 sec.
> He must cancle the fsockopen connection if the host is offline...


Use the timeout parameter of fsockopen:

http://us2.php.net/manual/de/function.fsockopen.php

Also see:

http://us2.php.net/manual/de/functio...et-timeout.php

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Reply With Quote
  #3 (permalink)  
Old 10-28-2003
Steve
 
Posts: n/a
Default Re: Time -> Cancle

"Sven Dzepina" <mail@styleswitch.de> wrote in message news:<3f9e0753$0$19084$9b4e6d93@newsread2.arcor-online.net>...
> Hello,
>
> How I can cancle or jump over to the next if the progress is longer than 1
> sec.
> He must cancle the fsockopen connection if the host is offline...
>
> Here is my Code:
>
> /////////////////////////////////////////////////////////////////////
>
> $s = explode(" ",microtime());
>
> $Starttime = $s[1]+$s[0];
>
>
>
> // AUSWERTUNG HIER ANFANG PING & PORT KONTROLLE ==> ANFANG <==
>
> $socket = @fsockopen($IP, $PO, &$errno, &$errstr);
>
> // AUSWERTUNG HIER ENDE PING & PORT KONTROLLE ==> ENDE <==
>
>
>
> $t = explode( " ", microtime() );
>
> $Endtime= $t[1] + $t[0];
>
> $finalzeit = number_format( $Endtime-$Starttime, 3);
>
> /////////////////////////////////////////////////////////////////////


I can't say for certain, because I can't quite tell what you are
trying to accomplish. But if you are trying what I think, you should
be able to do this much simpler and easier with CURL

If I am correct, you have a list of hosts that you want to try, in
succession, after a timeout.

Someone else correct me, but can't you just pass CURL and array with
the host names, and the specific time-out, and let it handle the rest?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0