Skip to content

Commit f21b852

Browse files
committed
fix a bug: str in C language end with \00
1 parent 3b4503d commit f21b852

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ def recvThread():
303303
if recvMsg(byref(msgNum), content) == 0:
304304
print("SERVER_from_IO : the content type is %s, the content number is %d, the content is:%s" % (type(content.value), msgNum.value, content.value))
305305
if(msgNum.value == MSG_REAL_TIME_RECORD):
306-
msgType_to_functions(msgNum.value, content.value)
306+
#create_string_buffer的value属性是将它当成一个\0结尾的字符串获取值,raw属性是当成字节流
307+
msgType_to_functions(msgNum.value, content.raw)
307308
else:
308309
msgType_to_functions(msgNum.value, str(content.value, encoding='utf-8'))
309310
else:

0 commit comments

Comments
 (0)