the following is the log of the client on the server
ConfigInit demo ...
config server judge
ConfigInit -> init
get_swoole_client
pms_config:9502
ConfigInit -> init end
Receive: s:22:"!";
Receive: s:6:"wocao!";
ConfigInit demo ...
config server judge
ConfigInit -> init
get_swoole_client
pms_config:9502
ConfigInit -> init end
Receive: s:22:"!";
s:6:"wocao!";
ConfigInit demo ...
config server judge
ConfigInit -> init
get_swoole_client
pms_config:9502
ConfigInit -> init end
Receive: s:22:"!";
s:6:"wocao!";
ConfigInit demo ...
config server judge
ConfigInit -> init
get_swoole_client
pms_config:9502
ConfigInit -> init end
Receive: s:22:"!";
Receive: s:6:"wocao!";
Receive is the callback function received. The code is as follows:
/**
*
* @param \swoole_client $cli
* @param $data
*/
public function receive(\swoole_client $cli, $data)
{
echo "Receive: $data \n";
}
the server keeps sending serialized "illegal controller" and "wocao" to the client twice (an interval of 1 second). Sometimes the client receives it separately, sometimes it merges it together. What if the server sends two serialized "illegal controllers" and "illegal controllers" to the client? Can"t receive it together, is there any way to handle the callback!
solve!
the above code is used for the communication between two service, the reference of swoole: https://wiki.swoole.com/wiki/.