note 52876 added to function.socket-accept

From: Date: Mon, 16 May 2005 15:11:25 +0000
Subject: note 52876 added to function.socket-accept
Groups: php.notes 
Request: Send a blank email to php-notes+get-89493@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! This example doesn't work. You have to call socket_listen($fd) after your bind in order to accept incoming connections. Simon ---- Manual Page -- http://www.php.net/manual/en/function.socket-accept.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52876 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52876&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52876&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52876&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52876&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52876&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52876&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89493) next »