note 35071 modified in function.socket-accept by vincent

From: Date: Sat, 23 Aug 2003 13:40:09 +0000
Subject: note 35071 modified in function.socket-accept by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54945@lists.php.net to get a copy of this message
Accepting a connection using php-sockets: $fd = socket_create(AF_INET, SOCK_STREAM, 6 /* OR getprotobyname("TCP")*/); $PORT = 5000; socket_bind($fd, "0.0.0.0", $PORT); while(true) { $remote_fd = socket_accept($fd); remote_socket_client_handle($remote_fd); } It is simple! --was-- Accepting a connection using php-sockets: $fd = socket_create(AF_INET, SOCK_STREAM, 6 /* OR getprotobyname("TCP")*/); $PORT = 5000; socket_bind($socket, "0.0.0.0", $PORT); while(true) { $remote_fd = socket_accept($fd); remote_socket_client_handle($remote_fd); } It is simple! http://www.php.net/manual/en/function.socket-accept.php

« previous php.notes (#54945) next »