is there a boss who can take a look at the problem of udp server? the code copied on the official website is sent by multiple udp software assistants. The sender information cannot be printed under
cli. It seems that no message has been received at all. The configuration should be correct. Both tcp and websocket can be used normally.
code is as follows:
php
$serv = new swoole_server ("0.0.0.0", 39502, SWOOLE_PROCESS, SWOOLE_SOCK_UDP);
/ listen to the data receive event Packet
$serv- > on ("Packet", function ($serv, $data, $clientInfo) {
$serv->sendto($clientInfo["address"], $clientInfo["port"], "Server ".$data);
var_dump($clientInfo);
});
/ / start the server
$serv- > start ();