Broken pipe 客户端关闭写后,继续发数据:

Broken pipe  客户端关闭写后,继续发数据:

node2:/root/test#cat t18.py 
import socket
import time
import struct
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# SEND_BUF_SIZE = 2
s.connect(("192.168.137.2",8080))
s.send('4444')
s.shutdown(1)
s.send('4444')
node2:/root/test#python t18.py 
Traceback (most recent call last):
  File "t18.py", line 9, in <module>
    s.send('4444')
socket.error: [Errno 32] Broken pipe
发布了3883 篇原创文章 · 获赞 120 · 访问量 360万+

猜你喜欢

转载自blog.csdn.net/zhaoyangjian724/article/details/105127337