server.py | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
server.py
@@ -106,7 +106,7 @@ try: # 如果带有头 if _str.startswith("##"): print("接受到数据:",f"{_str[:20]}...{_str[-20:]}") total_length = int(_str[2:10]) _str = _str[10:] # 防止socket数据发生粘连 @@ -116,6 +116,7 @@ _str += d.decode(encoding='gbk') type = data_process.parseType(_str) except Exception as e: print("接受到的异常数据:", f"{_str[:10]}...{_str[-10:]}") if str(e).find("Unterminated string starting") > -1: _str = _str.replace("\n", "") type = data_process.parseType(_str)