This commit is contained in:
Stefan Krah 2012-03-23 16:37:41 +01:00
commit 0175af85a5
1 changed files with 10 additions and 6 deletions

View File

@ -789,13 +789,17 @@ class BaseTestAPI(unittest.TestCase):
count=500))
t.start()
for x in range(20):
s = socket.socket(self.family, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
struct.pack('ii', 1, 0))
s.connect(server.address)
s.close()
s = socket.socket(self.family, socket.SOCK_STREAM)
s.settimeout(.2)
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
struct.pack('ii', 1, 0))
try:
s.connect(server.address)
except socket.error:
pass
finally:
s.close()
class TestAPI_UseIPv4Sockets(BaseTestAPI):
family = socket.AF_INET