奇怪的网络问题

奇怪的网络问题

今天测试网络的发送超时,写的简单程序,却出现异常行为,不解中

server.py

server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
server_socket.bind(("", 1234))
server_socket.listen(5)

print "begin accept"
client_socket,address = server_socket.accept()
client_socket.setsockopt(socket.SOL_SOCKET,socket.SO_RCVBUF,0)
print "accept finish"
ret = client_socket.recv(4096)
print ret
time.sleep(10000000)
print "ret",ret

client.py:

import socket
import time

client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(("localhost",1234))

print client_socket

print "send data"
client_socket.setsockopt(socket.SOL_SOCKET,socket.SO_SNDBUF,1)

total = 0
while 1:
    ret = client_socket.send("hello,world")
    total += ret
    print "send %d" % total

time.sleep(100)

我先启动server,然后启动client,一切正常。然后我关闭client(ctrl + c) , 在执行client,奇怪的是client还可以连上server,并且可以继续发送数据!!!但是server只做了一次accept,这后一次是怎样连上的啊?
通过netstat观察,确实是有个新的连接
tcp        0      0 localhost.localdomain:57341 localhost.localdomain:1234  FIN_WAIT2   
tcp        0     12 localhost.localdomain:57340 localhost.localdomain:1234  FIN_WAIT1  

这后一个连接是怎样连上的啊?
你加上server_socket.close()再试试