Worker发送信息到客户端后连接会断开


use Workerman\Worker;
use Workerman\Autoloader;

// autoload
require_once __DIR__ . '/../../Workerman/Autoloader.php';


$worker = new Worker("tcp://0.0.0.0:3737");
$worker->name = 'gbapp';
$worker->onMessage = function($connection, $data)
{
foreach($connection->worker->connections as $con)
{
$con->send($data);
}
};
Worker::runAll();
已邀请:

walkor

赞同来自:

代码本地测试没有问题。


telnet 127.0.0.1 3737
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
hello
hello
hi
hi


请说明使用的客户端,如何操作出现的问题,问题现象?

要回复问题请先登录注册