Python 清空阻塞模式socket缓冲区

s_cm.setblocking(False)
while True:
    try:
        data=s_cm.recvfrom(2048)
    except Exception as e:
        #print str(e)
        break
s_cm.setblocking(True)

你可能感兴趣的:(Python 清空阻塞模式socket缓冲区)