I need to know what code to write when a connection fails.
Posted: Fri Sep 16, 2011 1:12 pm
I need to know what code to write when a connection fails.
In all tutorials I usually find:
But I actually want to try the connection again after a while, and probably several times, but not infinitely.
Could you show me some example of code to implement in the if statement ?
thanks
In all tutorials I usually find:
Code: Select all
$fp = stream_socket_client("tcp://www.example.com:80", $errno, $errstr, 30);
if (!$fp) {
print "some error" //HERE I WANT SOME SERIOUS CODE
}
...
Could you show me some example of code to implement in the if statement ?
thanks