[Add] ws:在记录最后接收到的数据时尝试解包,若解包失败则使用原来的值

This commit is contained in:
nanoric 2018-11-26 04:15:23 -04:00
parent 31784f32b6
commit 268f833bdc

View File

@ -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]