use \GatewayWorker\Lib\Gateway;
Gateway::$registerAddress = '0.0.0.0:1233';
for ($i = 1;$i<100;$i++) {
Gateway::sendToClient("000000000b540000002c",json_encode(['ping' => 111111111111111111111111111111111111111111111111111111111111111111111111]));
}
print_r(Gateway::getClientSessionsByGroup("aa"));
消息发送不出去。抓包心跳消息却能实时推送, sendGroup和sendToClient全都发送不出去,
16:05:46.059100 IP 103.43.71.160.42918 > 172.28.44.247.80: Flags [P.], seq 1275:1300, ack 1072, win 501, options [nop,nop,TS val 3798591775 ecr 1480467979], length 25: HTTP
E..M..@.2.(&g+G...,....PD<.K..d7....=z.....
.i..X>&.......{"ping":1753344346}
16:05:46.059639 IP 172.28.44.247.80 > 103.43.71.160.42918: Flags [P.], seq 1072:1093, ack 1300, win 235, options [nop,nop,TS val 1480472980 ecr 3798591775], length 21: HTTP
E..I`.@.@.R...,.g+G..P....d7D<.d...........
X>9..i....{"pong":1753344346}
16:05:46.134120 IP 103.43.71.160.42918 > 172.28.44.247.80: Flags [.], ack 1093, win 501, options [nop,nop,TS val 3798591850 ecr 1480472980], length 0
E..4..@.2.(>g+G...,....PD<.d..dL.....b.....
.i.jX>9.
文档上写了