php
use \GatewayWorker\Lib\Gateway;
use \GatewayWorker\Lib\Db;
use Workerman\Lib\Timer;
use Workerman\Worker;
$task = new Worker();
$task->name = 'task';
// 开启多少个进程运行定时任务,注意多进程并发问题
$task->count =sendStr = "24 40 24 40 00 01 01";
$sendStrArray = str_split(str_replace(' ', '', $sendStr), 2); // 将16进制数据转换成两个一组的数组while($receiveStr = socket_read($socket, 8192)) {
$receiveStrHex = bin2hex($receiveStr); // 将2进制数据转换成16进制
$param=analysis($receiveStrHex);
if(!