Re: Socket() Error

From: Date: Thu, 02 Nov 2000 00:29:54 +0000
Subject: Re: Socket() Error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-36726@lists.php.net to get a copy of this message
> 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

« previous php.dev (#36726) next »