note 53786 added to function.socket-bind
| From: | php50613160534 dot 3 dot korkman at spamgourmet dot org | Date: | Mon, 13 Jun 2005 13:16:16 +0000 |
| Subject: | note 53786 added to function.socket-bind | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90352@lists.php.net to get a copy of this message | ||
Use 0 for port to bind a random (free) port for incoming connections:
socket_bind ($socket, $bind_address, 0);
socket_getsockname($socket, $socket_address, $socket_port);
socket_listen($socket);
...
$socket_port contains the assigned port, you might want to send it to a remote client connecting.
Tested with php 5.03.
----
Manual Page -- http://www.php.net/manual/en/function.socket-bind.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53786
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53786&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53786&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53786&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53786&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53786&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53786&report=yes
Search -- http://master.php.net/manage/user-notes.php