note 27644 added to function.socket-accept
| From: | diogo at michelangelo dot edu dot br | Date: | Fri, 13 Dec 2002 21:42:33 +0000 |
| Subject: | note 27644 added to function.socket-accept | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40884@lists.php.net to get a copy of this message | ||
Hi! With listen() we can to create a server application, as follow:
//first we must to create a socket which will be used to listen
// a connection (0 mean protocol type - TCP)
$mysock = socket_create(AF_INET, SOCK_STREAM, 0);
//now bind call a port (20000) with a socket on 127.0.0.1
//address
socket_bind($mysock, "127.0.0.1", 20000);
//accepting conenctions on a socket and port
socket_accept($mysock);
//using socket_listen we can specify how much connections
//we will to accept
socket_listen($socket, 10);
It´s very good!
--
http://www.php.net/manual/en/function.socket-accept.php
http://master.php.net/manage/user-notes.php?action=edit+27644
http://master.php.net/manage/user-notes.php?action=delete+27644
http://master.php.net/manage/user-notes.php?action=reject+27644