Re: [PHP-DEV] Socket() Error From: chrisv <email protected>
Date: 11/01/00

> PHP 4.0.3pl1 on a SMP Linux box with Kernel 2.2.16 --
>
> Anytime I try to call socket() like :
>
> socket (AF_INET, SOCK_STREAM,0)
>
> I get :
>
> Call to socket() failed: reason: Unknown error 4294967293

Are you looking for a non-zero return from socket or a negative return
from socket? The function has pretty much the same semantics as the
socket(2) system call, except for the return value is the opposite of the
errno value.

Try code that looks like:

$fd = socket(AF_INET, SOCK_STREAM, 0);
if ($fd < 0) { // socket() *can* return 0.
        print "Call to socket() failed: reason: " . strerror($fd) . "\n";
        exit;
}

Chris

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>