• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Fork me on GitHub
            隨筆 - 215  文章 - 13  trackbacks - 0
            <2016年9月>
            28293031123
            45678910
            11121314151617
            18192021222324
            2526272829301
            2345678


            專注即時(shí)通訊及網(wǎng)游服務(wù)端編程
            ------------------------------------
            Openresty 官方模塊
            Openresty 標(biāo)準(zhǔn)模塊(Opm)
            Openresty 三方模塊
            ------------------------------------
            本博收藏大部分文章為轉(zhuǎn)載,并在文章開頭給出了原文出處,如有再轉(zhuǎn),敬請保留相關(guān)信息,這是大家對原創(chuàng)作者勞動(dòng)成果的自覺尊重!!如為您帶來不便,請于本博下留言,謝謝配合。

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            相冊

            Awesome

            Blog

            Book

            GitHub

            Link

            搜索

            •  

            積分與排名

            • 積分 - 217652
            • 排名 - 118

            最新評論

            閱讀排行榜

            PHP高級編程之守護(hù)進(jìn)程

            http://netkiller.github.io/journal/php.daemon.html

            Mr. Neo Chen (陳景峯), netkiller, BG7NYT

            1. 什么是守護(hù)進(jìn)程

            守護(hù)進(jìn)程是脫離于終端并且在后臺(tái)運(yùn)行的進(jìn)程。守護(hù)進(jìn)程脫離于終端是為了避免進(jìn)程在執(zhí)行過程中的信息在任何終端上顯示并且進(jìn)程也不會(huì)被任何終端所產(chǎn)生的終端信息所打斷。

            例如 apache, nginx, mysql 都是守護(hù)進(jìn)程

            2. 為什么開發(fā)守護(hù)進(jìn)程

            很多程序以服務(wù)形式存在,他沒有終端或UI交互,它可能采用其他方式與其他程序交互,如TCP/UDP Socket, UNIX Socket, fifo。程序一旦啟動(dòng)便進(jìn)入后臺(tái),直到滿足條件他便開始處理任務(wù)。

            3. 何時(shí)采用守護(hù)進(jìn)程開發(fā)應(yīng)用程序

            以我當(dāng)前的需求為例,我需要運(yùn)行一個(gè)程序,然后監(jiān)聽某端口,持續(xù)接受服務(wù)端發(fā)起的數(shù)據(jù),然后對數(shù)據(jù)分析處理,再將結(jié)果寫入到數(shù)據(jù)庫中; 我采用ZeroMQ實(shí)現(xiàn)數(shù)據(jù)收發(fā)。

            如果我不采用守護(hù)進(jìn)程方式開發(fā)該程序,程序一旦運(yùn)行就會(huì)占用當(dāng)前終端窗框,還有受到當(dāng)前終端鍵盤輸入影響,有可能程序誤退出。

            4. 守護(hù)進(jìn)程的安全問題

            我們希望程序在非超級用戶運(yùn)行,這樣一旦由于程序出現(xiàn)漏洞被駭客控制,攻擊者只能繼承運(yùn)行權(quán)限,而無法獲得超級用戶權(quán)限。

            我們希望程序只能運(yùn)行一個(gè)實(shí)例,不運(yùn)行同事開啟兩個(gè)以上的程序,因?yàn)闀?huì)出現(xiàn)端口沖突等等問題。

            5. 怎樣開發(fā)守護(hù)進(jìn)程

            例 1. 多線程守護(hù)進(jìn)程例示
            			
            <?php
            class ExampleWorker extends Worker {
            
            	#public function __construct(Logging $logger) {
            	#	$this->logger = $logger;
            	#}
            
            	#protected $logger;
            	protected  static $dbh;
            	public function __construct() {
            
            	}
            	public function run(){
            		$dbhost = '192.168.2.1';			// 數(shù)據(jù)庫服務(wù)器
            		$dbport = 3306;
            	    $dbuser = 'www';        			// 數(shù)據(jù)庫用戶名
                    $dbpass = 'qwer123';             	// 數(shù)據(jù)庫密碼
            		$dbname = 'example';				// 數(shù)據(jù)庫名
            
            		self::$dbh  = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname", $dbuser, $dbpass, array(
            			/* PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'', */
            			PDO::MYSQL_ATTR_COMPRESS => true,
            			PDO::ATTR_PERSISTENT => true
            			)
            		);
            
            	}
            	protected function getInstance(){
                    return self::$dbh;
                }
            
            }
            
            /* the collectable class implements machinery for Pool::collect */
            class Fee extends Stackable {
            	public function __construct($msg) {
            		$trades = explode(",", $msg);
            		$this->data = $trades;
            		print_r($trades);
            	}
            
            	public function run() {
            		#$this->worker->logger->log("%s executing in Thread #%lu", __CLASS__, $this->worker->getThreadId() );
            
            		try {
            			$dbh  = $this->worker->getInstance();
            			
            			$insert = "INSERT INTO fee(ticket, login, volume, `status`) VALUES(:ticket, :login, :volume,'N')";
            			$sth = $dbh->prepare($insert);
            			$sth->bindValue(':ticket', $this->data[0]);
            			$sth->bindValue(':login', $this->data[1]);
            			$sth->bindValue(':volume', $this->data[2]);
            			$sth->execute();
            			$sth = null;
            			
            			/* ...... */
            			
            			$update = "UPDATE fee SET `status` = 'Y' WHERE ticket = :ticket and `status` = 'N'";
            			$sth = $dbh->prepare($update);
            			$sth->bindValue(':ticket', $this->data[0]);
            			$sth->execute();
            			//echo $sth->queryString;
            			//$dbh = null;
            		}
            		catch(PDOException $e) {
            			$error = sprintf("%s,%s\n", $mobile, $id );
            			file_put_contents("mobile_error.log", $error, FILE_APPEND);
            		}
            	}
            }
            
            class Example {
            	/* config */
            	const LISTEN = "tcp://192.168.2.15:5555";
            	const MAXCONN = 100;
            	const pidfile = __CLASS__;
            	const uid	= 80;
            	const gid	= 80;
            	
            	protected $pool = NULL;
            	protected $zmq = NULL;
            	public function __construct() {
            		$this->pidfile = '/var/run/'.self::pidfile.'.pid';
            	}
            	private function daemon(){
            		if (file_exists($this->pidfile)) {
            			echo "The file $this->pidfile exists.\n";
            			exit();
            		}
            		
            		$pid = pcntl_fork();
            		if ($pid == -1) {
            			 die('could not fork');
            		} else if ($pid) {
            			 // we are the parent
            			 //pcntl_wait($status); //Protect against Zombie children
            			exit($pid);
            		} else {
            			// we are the child
            			file_put_contents($this->pidfile, getmypid());
            			posix_setuid(self::uid);
            			posix_setgid(self::gid);
            			return(getmypid());
            		}
            	}
            	private function start(){
            		$pid = $this->daemon();
            		$this->pool = new Pool(self::MAXCONN, \ExampleWorker::class, []);
            		$this->zmq = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REP);
            		$this->zmq->bind(self::LISTEN);
            		
            		/* Loop receiving and echoing back */
            		while ($message = $this->zmq->recv()) {
            			//print_r($message);
            			//if($trades){
            					$this->pool->submit(new Fee($message));
            					$this->zmq->send('TRUE');  
            			//}else{
            			//		$this->zmq->send('FALSE');  
            			//}
            		}
            		$pool->shutdown();	
            	}
            	private function stop(){
            
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			posix_kill($pid, 9); 
            			unlink($this->pidfile);
            		}
            	}
            	private function help($proc){
            		printf("%s start | stop | help \n", $proc);
            	}
            	public function main($argv){
            		if(count($argv) < 2){
            			printf("please input help parameter\n");
            			exit();
            		}
            		if($argv[1] === 'stop'){
            			$this->stop();
            		}else if($argv[1] === 'start'){
            			$this->start();
            		}else{
            			$this->help($argv[0]);
            		}
            	}
            }
            
            $cgse = new Example();
            $cgse->main($argv);
            			
            			

            例 2. 消息隊(duì)列與守護(hù)進(jìn)程
            			
            <?php
            declare(ticks = 1);
            require_once( __DIR__.'/autoload.class.php' );
            umask(077);	
            class EDM {
            	protected $queue;
            	public function __construct() {
            		global $argc, $argv;
            		$this->argc = $argc;
            		$this->argv = $argv;
            		$this->pidfile = $this->argv[0].".pid";
            		$this->config = new Config('mq');
            		$this->logging = new Logging(__DIR__.'/log/'.$this->argv[0].'.'.date('Y-m-d').'.log'); //.H:i:s
            		//print_r( $this->config->getArray('mq') );
            		//pcntl_signal(SIGHUP, array(&$this,"restart"));
            	}
            	protected function msgqueue(){
            		$exchangeName = 'email'; //交換機(jī)名
            		$queueName = 'email'; //隊(duì)列名
            		$routeKey = 'email'; //路由key
            		//創(chuàng)建連接和channel
            		$connection = new AMQPConnection($this->config->getArray('mq'));
            		if (!$connection->connect()) {
            			die("Cannot connect to the broker!\n");
            		}
            		$this->channel = new AMQPChannel($connection);
            		$this->exchange = new AMQPExchange($this->channel);
            		$this->exchange->setName($exchangeName);
            		$this->exchange->setType(AMQP_EX_TYPE_DIRECT); //direct類型
            		$this->exchange->setFlags(AMQP_DURABLE); //持久化
            		$this->exchange->declare();
            		//echo "Exchange Status:".$this->exchange->declare()."\n";
            		//創(chuàng)建隊(duì)列
            		$this->queue = new AMQPQueue($this->channel);
            		$this->queue->setName($queueName);
            		$this->queue->setFlags(AMQP_DURABLE); //持久化
            		$this->queue->declare();
            		//echo "Message Total:".$this->queue->declare()."\n";
            		//綁定交換機(jī)與隊(duì)列,并指定路由鍵
            		$bind = $this->queue->bind($exchangeName, $routeKey);
            		//echo 'Queue Bind: '.$bind."\n";
            		//阻塞模式接收消息
            		while(true){
            			//$this->queue->consume('processMessage', AMQP_AUTOACK); //自動(dòng)ACK應(yīng)答
            			$this->queue->consume(function($envelope, $queue) {
            				$msg = $envelope->getBody();
            				$queue->ack($envelope->getDeliveryTag()); //手動(dòng)發(fā)送ACK應(yīng)答
            				$this->logging->info('('.'+'.')'.$msg);
            				//$this->logging->debug("Message Total:".$this->queue->declare());
            			});
            			$this->channel->qos(0,1);
            			//echo "Message Total:".$this->queue->declare()."\n";
            		}
            		$conn->disconnect();
            	}
            	protected function start(){
            		if (file_exists($this->pidfile)) {
            			printf("%s already running\n", $this->argv[0]);
            			exit(0);
            		}
            		$this->logging->warning("start");
            		$pid = pcntl_fork();
            		if ($pid == -1) {
            			die('could not fork');
            		} else if ($pid) {
            			//pcntl_wait($status); //等待子進(jìn)程中斷,防止子進(jìn)程成為僵尸進(jìn)程。
            			exit(0);
            		} else {
            			posix_setsid();
            			//printf("pid: %s\n", posix_getpid());
            			file_put_contents($this->pidfile, posix_getpid());
            			
            			//posix_kill(posix_getpid(), SIGHUP);
            			
            			$this->msgqueue();
            		}
            	}
            	protected function stop(){
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			posix_kill($pid, SIGTERM);
            			//posix_kill($pid, SIGKILL);
            			unlink($this->pidfile);
            			$this->logging->warning("stop");
            		}else{
            			printf("%s haven't running\n", $this->argv[0]);
            		}
            	}
            	protected function restart(){
            		$this->stop();
            		$this->start();	
            	}
            	protected function status(){
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			printf("%s already running, pid = %s\n", $this->argv[0], $pid);
            		}else{
            			printf("%s haven't running\n", $this->argv[0]);
            		}
            	}
            	protected function usage(){
            		printf("Usage: %s {start | stop | restart | status}\n", $this->argv[0]);
            	}
            	public function main(){
            		//print_r($this->argv);
            		if($this->argc != 2){
            			$this->usage();
            		}else{
            			if($this->argv[1] == 'start'){
            				$this->start();
            			}else if($this->argv[1] == 'stop'){
            				$this->stop();
            			}else if($this->argv[1] == 'restart'){
            				$this->restart();
            			}else if($this->argv[1] == 'status'){
            				$this->status();
            			}else{
            				$this->usage();
            			}
            		}
            	}
            }
            $edm = New EDM();
            $edm->main();
            			
            			

            5.1. 程序啟動(dòng)

            下面是程序啟動(dòng)后進(jìn)入后臺(tái)的代碼

            通過進(jìn)程ID文件來判斷,當(dāng)前進(jìn)程狀態(tài),如果進(jìn)程ID文件存在表示程序在運(yùn)行中,通過代碼file_exists($this->pidfile)實(shí)現(xiàn),但而后進(jìn)程被kill需要手工刪除該文件才能運(yùn)行

            			
            	private function daemon(){
            		if (file_exists($this->pidfile)) {
            			echo "The file $this->pidfile exists.\n";
            			exit();
            		}
            		
            		$pid = pcntl_fork();
            		if ($pid == -1) {
            			 die('could not fork');
            		} else if ($pid) {
            			// we are the parent
            			//pcntl_wait($status); //Protect against Zombie children
            			exit($pid);
            		} else {
            			// we are the child
            			file_put_contents($this->pidfile, getmypid());
            			posix_setuid(self::uid);
            			posix_setgid(self::gid);
            			return(getmypid());
            		}
            	}
            			
            			

            程序啟動(dòng)后,父進(jìn)程會(huì)推出,子進(jìn)程會(huì)在后臺(tái)運(yùn)行,子進(jìn)程權(quán)限從root切換到指定用戶,同時(shí)將pid寫入進(jìn)程ID文件。

            5.2. 程序停止

            程序停止,只需讀取pid文件,然后調(diào)用posix_kill($pid, 9); 最后將該文件刪除。

            			
            	private function stop(){
            
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			posix_kill($pid, 9); 
            			unlink($this->pidfile);
            		}
            	}
            			
            			

            5.3. 單例模式

            所有線程共用數(shù)據(jù)庫連接,在多線程中這個(gè)非常重要,如果每個(gè)線程建立以此數(shù)據(jù)庫連接在關(guān)閉,這對數(shù)據(jù)庫的開銷是巨大的。

            protected function getInstance(){
            	return self::$dbh;
            }			
            			

            5.4. 實(shí)現(xiàn)優(yōu)雅重啟

            所謂優(yōu)雅重啟是指進(jìn)程不退出的情況加實(shí)現(xiàn)重新載入包含重置變量,刷新配置文件,重置日志等等

            stop/start 或者 restart都會(huì)退出進(jìn)程,重新啟動(dòng),導(dǎo)致進(jìn)程ID改變,同時(shí)瞬間退出導(dǎo)致業(yè)務(wù)閃斷。所以很多守護(hù)進(jìn)程都會(huì)提供一個(gè)reload功能,者就是所謂的優(yōu)雅重啟。

            reload 實(shí)現(xiàn)原理是給進(jìn)程發(fā)送SIGHUP信號,可以通過kill命令發(fā)送 kill -s SIGHUP 64881,也可以通過庫函數(shù)實(shí)現(xiàn) posix_kill(posix_getpid(), SIGUSR1);

            			
            <?php
            pcntl_signal(SIGTERM,  function($signo) {
                echo "\n This signal is called. [$signo] \n";
                Status::$state = -1;
            });
            
            pcntl_signal(SIGHUP,  function($signo) {
                echo "\n This signal is called. [$signo] \n";
                Status::$state = 1;
            	Status::$ini = parse_ini_file('test.ini');
            });
            
            class Status{
                public static $state = 0;
            	public static $ini = null;
            }
            
            $pid = pcntl_fork();
            if ($pid == -1) {
                die('could not fork');
            }
            
            if($pid) {
                // parent
            } else {
            	$loop = true;
            	Status::$ini = parse_ini_file('test.ini');
                while($loop) {
            		print_r(Status::$ini);
                    while(true) {
            			// Dispatching... 
            			pcntl_signal_dispatch();
            			if(Status::$state == -1) {
            				// Do something and end loop.
            				$loop = false;
            				break;
            			}
            			
            			if(Status::$state == 1) {
            				printf("This program is reload.\r\n");
            				Status::$state = 0;
            				break;
            			}
                        echo '.';
                        sleep(1);
                    }
                    echo "\n";
                }
                
                echo "Finish \n";
                exit();
            }
            			
            			

            創(chuàng)建配置文件

            [root@netkiller pcntl]# cat test.ini 
            [db]
            host=192.168.0.1
            port=3306
            			

            測試方法,首先運(yùn)行該守護(hù)進(jìn)程

            # php signal.reload.php 
            Array
            (
                [host] => 192.168.0.1
                [port] => 3306
            )
            			

            現(xiàn)在修改配置文件,增加user=test配置項(xiàng)

            [root@netkiller pcntl]# cat test.ini 
            [db]
            host=192.168.0.1
            port=3306
            user=test
            			

            發(fā)送信號,在另一個(gè)終端窗口,通過ps命令找到該進(jìn)程的PID,然后使用kill命令發(fā)送SIGHUP信號,然后再通過ps查看進(jìn)程,你會(huì)發(fā)現(xiàn)進(jìn)程PID沒有改變

            [root@netkiller pcntl]# ps ax | grep reload
            64881 pts/0    S      0:00 php -c /srv/php/etc/php-cli.ini signal.reload.php
            65073 pts/1    S+     0:00 grep --color=auto reload
            
            [root@netkiller pcntl]# kill -s SIGHUP 64881
            
            [root@netkiller pcntl]# ps ax | grep reload
            64881 pts/0    S      0:00 php -c /srv/php/etc/php-cli.ini signal.reload.php
            65093 pts/1    S+     0:00 grep --color=auto reload
            
            			

            配置文件被重新載入

            This signal is called. [1] 
            This program is reload.
            
            Array
            (
                [host] => 192.168.0.1
                [port] => 3306
                [user] => test
            )			
            			

            優(yōu)雅重啟完成。

            6. Example

            		
            <?php
            /*
             * PHP Daemon sample.
             * Home: http://netkiller.github.io
             * Author: netkiller<netkiller@msn.com>
             * 
            */
            class Logger {
            	
            	public function __construct(/*Logging $logger*/) {
            	}
            
            	public function logger($type, $message) {
            		$log = sprintf ( "%s\t%s\t%s\n", date ( 'Y-m-d H:i:s' ), $type, $message );
            		file_put_contents ( sprintf(__DIR__."/../log/sender.%s.log", date ( 'Y-m-d' )), $log, FILE_APPEND );
            	}
            	
            }
            
            final class Signal{	
                public static $signo = 0;
            	protected static $ini = null;
            	public static function set($signo){
            		self::$signo = $signo;
            	}
            	public static function get(){
            		return(self::$signo);
            	}
            	public static function reset(){
            		self::$signo = 0;
            	}
            }
            
            class Test extends Logger {
            	//public static $signal = null;
            	
            	public function __construct() {
            		//self::$signal == null;
            	}
            	public function run(){
            		while(true){
            			pcntl_signal_dispatch();
            			printf(".");
            			sleep(1);
            			if(Signal::get() == SIGHUP){
            				Signal::reset();
            				break;
            			}
            		}
            		printf("\n");
            	}
            }
            
            class Daemon extends Logger {
            	/* config */
            	const LISTEN = "tcp://192.168.2.15:5555";
            	const pidfile 	= __CLASS__;
            	const uid		= 80;
            	const gid		= 80;
            	const sleep	= 5;
            
            	protected $pool 	= NULL;
            	protected $config	= array();
            
            	public function __construct($uid, $gid, $class) {
            		$this->pidfile = '/var/run/'.basename(get_class($class), '.php').'.pid';
            		//$this->config = parse_ini_file('sender.ini', true); //include_once(__DIR__."/config.php");
            		$this->uid = $uid;
            		$this->gid = $gid;
            		$this->class = $class;
            		$this->classname = get_class($class);
            		
            		$this->signal();
            	}
            	public function signal(){
            
            		pcntl_signal(SIGHUP,  function($signo) /*use ()*/{
            			//echo "\n This signal is called. [$signo] \n";
            			printf("The process has been reload.\n");
            			Signal::set($signo);
            		});
            
            	}
            	private function daemon(){
            		if (file_exists($this->pidfile)) {
            			echo "The file $this->pidfile exists.\n";
            			exit();
            		}
            
            		$pid = pcntl_fork();
            		if ($pid == -1) {
            			 die('could not fork');
            		} else if ($pid) {
            			 // we are the parent
            			 //pcntl_wait($status); //Protect against Zombie children
            			exit($pid);
            		} else {
            			file_put_contents($this->pidfile, getmypid());
            			posix_setuid(self::uid);
            			posix_setgid(self::gid);
            			return(getmypid());
            		}
            	}
            	private function run(){
            
            		while(true){
            			
            			printf("The process begin.\n");
            			$this->class->run();
            			printf("The process end.\n");
            			
            		}
            	}
            	private function foreground(){
            		$this->run();
            	}
            	private function start(){
            		$pid = $this->daemon();
            		for(;;){
            			$this->run();
            			sleep(self::sleep);
            		}
            	}
            	private function stop(){
            
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			posix_kill($pid, 9);
            			unlink($this->pidfile);
            		}
            	}
            	private function reload(){
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			//posix_kill(posix_getpid(), SIGHUP);
            			posix_kill($pid, SIGHUP);
            		}
            	}	
            	private function status(){
            		if (file_exists($this->pidfile)) {
            			$pid = file_get_contents($this->pidfile);
            			system(sprintf("ps ax | grep %s | grep -v grep", $pid));
            		}
            	}
            	private function help($proc){
            		printf("%s start | stop | restart | status | foreground | help \n", $proc);
            	}
            	public function main($argv){
            
            		if(count($argv) < 2){
            			$this->help($argv[0]);
            			printf("please input help parameter\n");
            			exit();
            		}
            		if($argv[1] === 'stop'){
            			$this->stop();
            		}else if($argv[1] === 'start'){
            			$this->start();
                    }else if($argv[1] === 'restart'){
            			$this->stop();
                        $this->start();
            		}else if($argv[1] === 'status'){
            			$this->status();
            		}else if($argv[1] === 'foreground'){
            			$this->foreground();
            		}else if($argv[1] === 'reload'){
            			$this->reload();
            		}else{
            			$this->help($argv[0]);
            		}
            	}
            }
            
            $daemon = new Daemon(80,80, new Test());
            $daemon->main($argv);
            ?>
            		
            		

            7. 進(jìn)程意外退出解決方案

            如果是非常重要的進(jìn)程,必須要保證程序正常運(yùn)行,一旦出現(xiàn)任何異常退出,都需要做即時(shí)做處理。下面的程序可能檢查進(jìn)程是否異常退出,如果退出便立即啟動(dòng)。

            		
            #!/bin/sh
            
            LOGFILE=/var/log/$(basename $0 .sh).log
            PATTERN="my.php"
            RECOVERY="/path/to/my.php start"
            
            while true
            do
                    TIMEPOINT=$(date -d "today" +"%Y-%m-%d_%H:%M:%S")
                    PROC=$(pgrep -o -f ${PATTERN})
                    #echo ${PROC}
                    if [ -z "${PROC}" ]; then
            		${RECOVERY} >> $LOGFILE
                            echo "[${TIMEPOINT}] ${PATTERN} ${RECOVERY}" >> $LOGFILE
                            
                    #else
                            #echo "[${TIMEPOINT}] ${PATTERN} ${PROC}" >> $LOGFILE
                    fi
            sleep 5
            done &
            		
            		

            8. 延伸閱讀

            PHP高級編程之消息隊(duì)列

            PHP高級編程之多線程

            posted on 2016-09-01 13:46 思月行云 閱讀(350) 評論(0)  編輯 收藏 引用 所屬分類: PHP
            香蕉久久久久久狠狠色| 亚洲精品乱码久久久久久自慰 | 2019久久久高清456| 午夜天堂精品久久久久| 麻豆精品久久精品色综合| 久久精品国产亚洲Aⅴ香蕉| 一级做a爰片久久毛片16| 久久夜色精品国产亚洲| 亚洲人成网站999久久久综合| 人妻久久久一区二区三区| 国产精品亚洲综合专区片高清久久久| 亚洲国产天堂久久综合| 国内精品久久久久久99蜜桃| 无码人妻久久一区二区三区蜜桃| 久久夜色精品国产噜噜亚洲AV| 国产精品欧美亚洲韩国日本久久| 久久精品人人做人人爽电影蜜月 | 99久久精品午夜一区二区| 久久久久亚洲AV无码去区首| 久久精品免费一区二区三区| 色天使久久综合网天天| 久久久黄片| 国产免费久久精品丫丫| 国产精品视频久久久| 日本强好片久久久久久AAA| 伊人久久精品影院| 久久久这里有精品中文字幕| 久久精品国产一区| AV狠狠色丁香婷婷综合久久| 久久精品午夜一区二区福利| 中文字幕日本人妻久久久免费| 欧美久久一级内射wwwwww.| 狠狠色综合久久久久尤物| 成人a毛片久久免费播放| 国产ww久久久久久久久久| 成人亚洲欧美久久久久| 久久九九久精品国产免费直播| 国产午夜福利精品久久| 国产伊人久久| 亚洲国产成人精品无码久久久久久综合 | 久久免费的精品国产V∧ |