_sock = socket_create(AF_INET,SOCK_STREAM,SOL_TCP); $this->_sockets = new Sockets(); } public function start($ip,$port=23) {//{{{ global $errorObj; global $messageObj; if (socket_bind($this->_sock,$ip,$port)) { socket_listen($this->_sock); socket_set_nonblock($this->_sock); while (1) { usleep(1000000); print(date('H:i:s')." - executing loop...\n"); if (($thissock = socket_accept($this->_sock)) !== false) { if (stream_set_blocking($thissock,0)) { print('worked'); } $messageObj->add('Accepted socket.'); $this->_sockets->add($thissock); } $this->_sockets->readsockets(); } } else { socket_close($this->_sock); } } }//}}} ?>