|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-18 19:11 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
Description: ------------ socket_bind() function on Apache2/ Win2k can't bind Reproduce code: --------------- $dest="127.0.0.1"; $port=80; //"daemon" in UDP $socketD = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); if($socketD === FALSE) { // something went wrong echo 'socket_create failed: '.socket_strerror(socket_last_error())."\n"; exit(1); } /* This is the second option but still doesn't work if(!socket_bind($socketD, "0.0.0.0", 27123)) */ if(!socket_bind ($socketD, 0, $port)) { socket_close($socketD); echo 'socket_bind failed: '.socket_strerror(socket_last_error())."\n"; exit(1); } Expected result: ---------------- This is the PHP error message: Warning: socket_bind() [function.socket-bind]: unable to bind address [0]; I realy dug into the documentations and examples and find it hard to believe that I do something wrong. The warning message explains that the socket it already binded and cannot be used twice :((