From 268f833bdc62467698d2df07f38c032721b009de Mon Sep 17 00:00:00 2001 From: nanoric Date: Mon, 26 Nov 2018 04:15:23 -0400 Subject: [PATCH] =?UTF-8?q?[Add]=20ws:=E5=9C=A8=E8=AE=B0=E5=BD=95=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E6=8E=A5=E6=94=B6=E5=88=B0=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=8C=85=EF=BC=8C=E8=8B=A5?= =?UTF-8?q?=E8=A7=A3=E5=8C=85=E5=A4=B1=E8=B4=A5=E5=88=99=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=8E=9F=E6=9D=A5=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/api/websocket/WebsocketClient.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vnpy/api/websocket/WebsocketClient.py b/vnpy/api/websocket/WebsocketClient.py index b9d75e84..8583d4f7 100644 --- a/vnpy/api/websocket/WebsocketClient.py +++ b/vnpy/api/websocket/WebsocketClient.py @@ -263,11 +263,16 @@ class WebsocketClient(object): """ 用于Debug: 记录最后一次发送出去的text """ - self._lastSentText = text[:500] + self._lastSentText = text[:1000] #---------------------------------------------------------------------- def _recordLastReceivedText(self, text): """ 用于Debug: 记录最后一次发送出去的text """ - self._lastReceivedText = text[:500] + try: + # 尝试解包,解不了就算 + text = str(self.unpackData(text)) + except: + pass + self._lastReceivedText = text[:1000]