国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

tp5.1里直接使用AsyncTcpConnection方法,報(bào)錯(cuò)Call to a member function add() on null

hw524926

上代碼

$connection = new AsyncTcpConnection('tcp://baidu.com:81');
// 執(zhí)行連接的時(shí)候還沒設(shè)置onError回調(diào)
$connection->connect();
$connection->onError = function($connection, $err_code, $err_msg)
{
    echo "$err_code, $err_msg";
};

報(bào)錯(cuò)
ThrowableError?in?AsyncTcpConnection.php line 203 致命錯(cuò)誤: Call to a member function add() on null

if ($this->_status === self::STATUS_CLOSING) { 
    $this->destroy(); 
} 
if ($this->_status === self::STATUS_CLOSED) { 
    $this->onConnect = null; 
} 
return; 
} 
// Add socket to global event loop waiting connection is successfully established or faild. 
Worker::$globalEvent->add($this->_socket, EventInterface::EV_WRITE, array($this, 'checkConnection')); 
// For windows. 
if(DIRECTORY_SEPARATOR === '\\') { 
Worker::$globalEvent->add($this->_socket, EventInterface::EV_EXCEPT, array($this, 'checkConnection'));
5642 3 0
3個(gè)回答

hw524926

我的async沒放在worker的onWokerStart里,是在代碼里直接使用的

  • 暫無評(píng)論
keytehu

AsyncTcpConnection 只能在workerman的運(yùn)行環(huán)境中使用吧

  • 暫無評(píng)論
1171659744_php

有大佬解決了嗎

  • 暫無評(píng)論
年代過于久遠(yuǎn),無法發(fā)表回答
??