problems with socket
| From: | G�nther Leitgeb | Date: | Tue, 17 Sep 2002 21:03:49 +0000 |
| Subject: | problems with socket | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2417@lists.php.net to get a copy of this message | ||
Hi
I hope someone can help me
I have made a program with a servercomponent
And this program connects to a PHP script on a webserver
and the script makes a socket connection to this servercomponent
and I want that this script logs into a database (or whatever) the logintime
and when the program disconnects
it works fine but if my internetconnection interrupts (for example my
provider makes a IP change) the script doesn't recognize it ....
what can I do??
my script:
$fp = fsockopen($ip, $port, &$err_num, &$err_msg, 10);
if ($fp)
{
$daten = "GET / HTTP/1.0\r\nUser-Agent: TestClient\r\n\r\n";
fputs($fp, $daten);
// Database Entry >ONLINE!<
while (!feof($fp))
{
$zwdaten .= fgets($fp, 1);
}
// Database Entry >OFFLINE!<
}
MFG
Günther Leitgeb
webmaster@gleitgeb.at webmaster@gl5funk.cjb.net
webmaster@gl-webradio.cjb.net webmaster@gl-netradio.cjb.net
ICQ: 104677570