Re: problems with socket
| From: | Steph | Date: | Wed, 18 Sep 2002 03:47:54 +0000 |
| Subject: | Re: problems with socket | ||
| References: | 1 | Groups: | php.general php.gtk.general |
| Request: | Send a blank email to php-general+get-116681@lists.php.net to get a copy of this message | ||
Fwd-ing to correct list ..
> 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
>
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>