|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2005-03-04 09:09 UTC] huoqi29 at 163 dot com
  [2005-03-04 11:32 UTC] tony2001@php.net
  [2005-03-12 01:00 UTC] php-bugs at lists dot php dot net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 13:00:01 2025 UTC | 
Description: ------------ If you uncomment the '//echo "Bug";' and when you run this script ,you will get the expect result if you don't logout, and when you login and "ps -aux " you can find it. But where you "telnet 127.0.0.1 99999" you can't connect it . Reproduce code: --------------- <?php if(pcntl_fork()){exit;} posix_setsid(); chdir("/"); umask(0); $sock=socket_create(AF_INET,SOCK_STREAM,SOL_TCP); socket_bind($sock,"127.0.0.1",99999); socket_listen($sock); $R=array($sock); while(1) { $T=$R; if($C=socket_select($T,$W=NULL,$E=NULL,0,0)) { foreach($T as $sock2) { if($sock2==$sock) { $client=socket_accept($sock); array_push($R,$client); } else{ //echo "Bug"; //socket_getpeername($sock2,&$add,&$prot); $B=socket_recv($sock2,$Buf,1024,0); if($B==0 || chop($Buf)=="quit" || chop($Buf)=="exit") { $I=array_search($sock2,$R); unset($R[$I]); socket_close($sock2); }else socket_send($sock2,"Hello".$Buf,1024,0); } } } } ?>