在一个Worker下执行异步调用tcp连接,但是触发不了onMessage,通信过程中能打印111111和333333,但打印不了222222。哪位大佬帮忙看看。谢谢!
$connection_tcp = new AsyncTcpConnection('tcp://127.0.0.1:8888');
$connection_tcp->send("hello");
echo '111111';
$connection_tcp->onMessage = function($connection_tcp, $result)
{
echo '222222';
echo $result;
$connection_tcp->close();
};
$connection_tcp->connect();
echo '333333';
8888 端口没返回数据就不会触发 onMessage 吧
有返回数据,但回调没有获取到