#server延时接收测试----------------------------------------------------------------------------------------
#server端---------------------------------------
import socket
import time
sk = socket.socket()
sk.bind(('127.0.0.1',8080))
sk.listen()
conn,addr = sk.accept()
time.sleep(10)
'''
客户端,先发送,我这边延时接收也是可以接收到的
对方sk关闭之后 我这边conn未关闭,接收空消息
'''
print(conn.recv(1024))
print(conn.recv(1024))
conn.close()
sk.close()
#server端---------------------------------------
#client端---------------------------------------
import socket
sk = socket.socket()
sk.connect(('127.0.0.1',8080))
sk.send(b'presend hello')
sk.close()
#client端---------------------------------------
#server延时接收测试----------------------------------------------------------------------------------------
server延时接收测试
s
erver延时接收测试