如下是服务器上的客户端的日志
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 是接收的回调函数 ,代码如下:
/**
* 收到值
* @param \swoole_client $cli
* @param $data
*/
public function receive(\swoole_client $cli, $data)
{
echo "Receive: $data \n";
}
服务器不停地(间隔1秒)分两次向客户端发送序列化的"不合法的控制器"和"wocao",有时候客户端是分开接收的,有时候是合并在一起接收的,怎么办?不能一起接收啊,呢个有没法处理回调了!!!!
求解!
上面的代码用于两个service 之间的通信,参考的的swoole的: https://wiki.swoole.com/wiki/...