Bug #10627 Updated: bind() fails
| From: | sniper@php.net | Date: | Thu, 03 May 2001 07:23:48 +0000 |
| Subject: | Bug #10627 Updated: bind() fails | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-53521@lists.php.net to get a copy of this message | ||
ID: 10627
Updated by: sniper
Reported By: old.wolf@project-w.com
Old-Status: Open
Status: Feedback
Bug Type: Sockets related
PHP Version: 4.0.5
Assigned To:
Comments:
Works for me with latest CVS on Linux just fine.
There have been some fixes in sockets extension since
4.0.5 so please try the latest CVS snapshot from http://snaps.php.net to check if they fix this.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-05-03 03:12:57] old.wolf@project-w.com
The sample code on the online documentation fails. Here is a shorter example which fails in the same
way:
$s = socket(AF_INET, SOCK_STREAM, 0);
$err = bind($s, "192.168.1.2", 44444);
if ($err)
die(strerror($err));
reports: Address family not supported by protocol family.
The same thing happens for other values of address and port, or using protocol 6 instead of 0.
I noticed that it is possible to call listen() without successfully calling bind(), in which case
the socket listens correctly on a random port number. (is this intentional?)
I also tried using the undocumented function open_listen_sock() instead (with the CGI version of php
invoked from the shell), which works once but then fails on future invocations with the same port
number, even though the socket and its accepted sockets were closed properly with close().
My configure line:
./configure --with-mcrypt --with-mhash --with-mysql=../../mysql --with-gd --enable-versioning
--with-ttf --enable-debug --enable-shared --enable-freetype-4bit-antialias-hack --with-informix
--with-bz2 --with-gmp --with-zlib --with-config-file-path=/usr/local/lib/cgiphp.ini --enable-sockets
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10627&edit=2