Subversion Repositories php-qbpwcf

Rev

Rev 68 | Rev 226 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68 Rev 71
Line 10119... Line 10119...
10119
	#response status code should be 101=>http://stackoverflow.com/questions/29829597/i-get-a-status-200-when-connecting-to-the-websocket-but-it-is-an-error
10119
	#response status code should be 101=>http://stackoverflow.com/questions/29829597/i-get-a-status-200-when-connecting-to-the-websocket-but-it-is-an-error
10120
	#webSocket實做=>http://srchea.com/build-a-real-time-application-using-html5-websockets
10120
	#webSocket實做=>http://srchea.com/build-a-real-time-application-using-html5-websockets
10121
	#webSocketServer實做=>http://www.cuelogic.com/blog/php-and-html5-websocket-server-and-client-communication/
10121
	#webSocketServer實做=>http://www.cuelogic.com/blog/php-and-html5-websocket-server-and-client-communication/
10122
	#備註:
10122
	#備註:
10123
	#僅能在命令列執行.
10123
	#僅能在命令列執行.
-
 
10124
	#runPhpWhenIdle的功能尚未實作.
10124
	*/
10125
	*/
10125
	public static function nativeSocketTcpIpServer(&$conf){
10126
	public static function nativeSocketTcpIpServer(&$conf){
10126
		
10127
		
10127
		#初始化要回傳的結果
10128
		#初始化要回傳的結果
10128
		$result=array();
10129
		$result=array();
Line 10655... Line 10656...
10655
							$result=call_user_func_array($if,$params);
10656
							$result=call_user_func_array($if,$params);
10656
					
10657
					
10657
							}#foreach end
10658
							}#foreach end
10658
					
10659
					
10659
						}#if end
10660
						}#if end
10660
						
-
 
10661
					#如果有php程式要於idle時執行
-
 
10662
					while(count($php2runWhenIdle)>0){
-
 
10663
					
-
 
10664
						#取得要執行的 php code
-
 
10665
						$phpCode=array_shift($php2runWhenIdle);
-
 
10666
					
10661
					
10667
						#...
10662
					#如果有 $php2runWhenIdle
-
 
10663
					if(isset($php2runWhenIdle)){
10668
					
10664
					
-
 
10665
						#如果有php程式要於idle時執行
-
 
10666
						while(count($php2runWhenIdle)>0){
-
 
10667
						
-
 
10668
							#取得要執行的 php code
-
 
10669
							$phpCode=array_shift($php2runWhenIdle);
-
 
10670
						
-
 
10671
							#...
-
 
10672
						
10669
						}#while end
10673
							}#while end
10670
					
10674
					
-
 
10675
						}#if end
-
 
10676
						
10671
					#下一輪
10677
					#下一輪
10672
					continue;
10678
					continue;
10673
					
10679
					
10674
					}#if end
10680
					}#if end
10675
				
10681