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();
代码本地测试没有问题。
telnet 127.0.0.1 3737
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
hello
hello
hi
hi
请说明使用的客户端,如何操作出现的问题,问题现象?