oh, error, no tu close fuera del loop esta bien, el problema es que no cierras el socket cliente cuando terminas de utilizarlo
On Fri, Jan 23, 2009 at 12:56 PM, Eduardo Silva <edsi...@gmail.com> wrote: > estas cerrando el socket fuera de tu loop, lo cual te hara llegar al limite > del sistema para ese proceso: 1024 si es usuario normal. > > > On Fri, Jan 23, 2009 at 12:46 PM, Alvaro Herrera > <alvhe...@alvh.no-ip.org>wrote: > >> Hector Salinas escribió: >> >> > #!/usr/bin/php -q >> > <?php >> > set_time_limit (0); >> > $address = '192.168.1.235'; >> > $port = 5000; >> > $sock = socket_create(AF_INET, SOCK_STREAM, 0); >> > socket_set_option($sock, SOL_SOCKET, SO_REUSEADDR, SOL_TCP); >> > socket_bind($sock, $address, $port) or die('error bind en la ip'); >> > socket_listen($sock); >> > while (true) >> > { >> > $client = socket_accept($sock); >> > socket_getpeername($client, $ip); >> > $input = socket_read($client, 10); >> > echo "\n*******************************"; >> > echo "\nNew client connected: {$ip}"; >> > echo "\nmemoria usada -->".memory_get_usage(); >> > socket_write($client, "A"); >> >> socket_close($client); ? >> >> > unset($input); >> > $contador++; >> > } >> > socket_close($sock); >> > ?> >> >> >> >> -- >> Alvaro Herrera >> http://www.advogato.org/person/alvherre >> "Industry suffers from the managerial dogma that for the sake of stability >> and continuity, the company should be independent of the competence of >> individual employees." (E. Dijkstra) >> > > > > -- > Eduardo Silva > http://edsiper.linuxchile.cl > -- Eduardo Silva http://edsiper.linuxchile.cl