diff --git a/lib/im/SocketClient.dart b/lib/im/SocketClient.dart index 696c4d8f..157b6281 100644 --- a/lib/im/SocketClient.dart +++ b/lib/im/SocketClient.dart @@ -60,6 +60,7 @@ class SocketClient { Uint8List data = utf8.encode(jsonEncode({"heartbeat": milliseTime})); MsgData msgData = MsgData(from: userId, type: MsgType.TEXT, data: data); final proto2 = Proto(3, 1, msgData.writeToBuffer()); + if(_socket != null) _socket.add(proto2.toBytes()); }); }