我的登錄是走的異步,登錄成功后把userid存入$_SESSION中,然后用戶發(fā)布消息,在主進程中獲取$_SESSION,但是在主進程中這個$_SESSION獲取不到,為什么?怎么才可以獲取到?...
$task = new AsyncTcpConnection('Text://127.0.0.1:8281'); $task->connect(); $task_data = array( 'function'=>'login', 'args'=>$args, ); $ta...
<?php use \GatewayWorker\Lib\Gateway; use \Workerman\Worker; use \Workerman\Connection\AsyncTcpConnection; use \Applications\YourApp\Controller\MyWm; use \Applications\YourApp\Database\MySql; require_once _...
問題: 我發(fā)送一個信息,要求在明天中午12:00點,發(fā)給所有在線用戶,然后關閉此定時器。, 我的實現(xiàn): $time_interval =60; \Workerman\Lib\Timer::add($time_interval, function($info,$onlinetime) { if(time()>=$onlinetime) { $info=json_encode($in...
$class = $message_data;//類 $method = $message_data;//方法 $args = $message_data;//參數(shù) if(file_exists(__DIR__.'/Controller/'.$class.'.class.php')) { require_once __DIR__.'/Controller/'.$...