Kaydet (Commit) d6868b4e authored tarafından Benjamin Peterson's avatar Benjamin Peterson

fix leaking sockets

üst d094efd8
......@@ -564,6 +564,7 @@ class BaseTestAPI(unittest.TestCase):
asyncore.dispatcher.handle_accept(self)
def handle_accepted(self, sock, addr):
sock.close()
self.flag = True
server = TestListener()
......@@ -721,6 +722,7 @@ class BaseTestAPI(unittest.TestCase):
s = asyncore.dispatcher(socket.socket())
self.assertFalse(s.socket.getsockopt(socket.SOL_SOCKET,
socket.SO_REUSEADDR))
s.socket.close()
s.create_socket(socket.AF_INET, socket.SOCK_STREAM)
s.set_reuse_addr()
self.assertTrue(s.socket.getsockopt(socket.SOL_SOCKET,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment