Browse Source

socketclient add debug setting

wr_202303
zsw 4 months ago
parent
commit
57b1e89ac3
  1. 5
      lib/im/SocketClient.dart

5
lib/im/SocketClient.dart

@ -70,7 +70,10 @@ class SocketClient {
Uint8List data = utf8.encode(jsonEncode({"heartbeat": milliseTime})); Uint8List data = utf8.encode(jsonEncode({"heartbeat": milliseTime}));
MsgData msgData = MsgData(from: userId, type: MsgType.TEXT, data: data); MsgData msgData = MsgData(from: userId, type: MsgType.TEXT, data: data);
final proto2 = Proto(3, 1, msgData.writeToBuffer()); final proto2 = Proto(3, 1, msgData.writeToBuffer());
if(_socket != null) if(!checkSocket()) {
timer.cancel();
return;
}
_socket.add(proto2.toBytes()); _socket.add(proto2.toBytes());
}); });
} }

Loading…
Cancel
Save