net bug fix and update function

This commit is contained in:
2019-12-19 08:09:06 +08:00
parent 9243c407a1
commit a35524eb0c
5 changed files with 80 additions and 28 deletions

View File

@@ -7,7 +7,7 @@ s.bind(('127.0.0.1', 3966))
s.listen(100)
id = '''post net msw/1.0
id: miku
id: miku2
from: test
length: 0
@@ -23,8 +23,13 @@ def process(conn, addr):
if not data:
conn.close()
return
data = data.decode()
print(data)
try:
data = data.decode()
print(data)
except UnicodeDecodeError:
print('Decode error')
print(data[:39])
while True: