-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> vs.
> 
> while(($retval==socket_read($sock, $buf, $len)) > 0) {
>       // do something
> }
> if ($retval==-1) {
>       print strerror(socket_last_error($sock));
> } elseif ($retval==0) {
>       $eof=1;
>       print "Eof has occured!!!";
> }


what about


while(socket_read($sock, $buf, $len)) {
        // do somthing
}

switch (socket_last_error($sock)) {
        case SOCKET_EOF:
                print "eof";
                break;

        default:
                print strerror(socket_last_message($sock));
}




harald.

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPHeMRK1+myS9SSHxEQK7TgCcCP8Z4vdnVfFOhjhBX+y/WBQ196UAoKl1
BPYcQ7yUWFo/O0VeJwf/9lE6
=xYWI
-----END PGP SIGNATURE-----


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to