传输层协议改成udp后访问报错是个什么情况?

muyuanya

修改位置:

require_once __DIR__ . '/../../Workerman/Autoloader.php';
Autoloader::setRootPath(__DIR__);
$gateway = new Gateway("Text://0.0.0.0:8282");

$gateway->transport = 'udp';

$gateway->name = 'MyAppGateway';
$gateway->count = 4;
$gateway->startPort = 2900;
$gateway->registerAddress = '127.0.0.1:1238';

使用nc命令访问
提示报错:

PHP Notice:  Undefined property: Workerman\Connection\UdpConnection::$gatewayHeader in /root/文档/sevice_linux/GatewayWorker/Gateway.php on line 259

Notice: Undefined property: Workerman\Connection\UdpConnection::$gatewayHeader in /root/文档/sevice_linux/GatewayWorker/Gateway.php on line 259
PHP Notice:  Undefined property: Workerman\Connection\UdpConnection::$session in /root/文档/sevice_linux/GatewayWorker/Gateway.php on line 262

写的一个小的物联网项目,需要通过udp接收数据

3381 1 0
1个回答

walkor 打赏

GatewayWorker用于tcp长连接应用,不支持udp传输协议

  • 暂无评论
年代过于久远,无法发表回答
×
🔝