onConnected method
WebSocketProvider
Implementation
@override
void onConnected(WebSocketChannel webSocket) {
logger.i('设备已连接到: ${CanaryWebSocket.instance.url}');
channel = webSocket;
_timer = Timer.periodic(const Duration(seconds: 10), (timer) {
_count++;
channel.send(OpCode.ping, _count.bytes());
});
register();
}