Discuss / Python / 接收数据的时候报错了

接收数据的时候报错了

Topic source

while True:

# 每次最多接收1k字节:
d = s.recv(1024)
if d:
    buffer.append(d)
else:
    break

ConnectionResetError: [Errno 54] Connection reset by peer

应该是buffer.append(d)这里出错,搜了一下说是可能exchange full,我将buffer.append(d)改成print(d)就能够将接收到的数据输出。


  • 1

Reply