This commit is contained in:
Giampaolo Rodola' 2012-03-23 13:29:01 +01:00
parent 42243c4dca
commit 466a54f4dc
1 changed files with 11 additions and 9 deletions

View File

@ -783,12 +783,14 @@ class BaseTestAPI(unittest.TestCase):
@support.reap_threads
def test_quick_connect(self):
# see: http://bugs.python.org/issue10340
server = TCPServer()
t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1, count=500))
if self.family in (socket.AF_INET, getattr(socket, "AF_INET6", object())):
server = BaseServer(self.family, self.addr)
t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
count=500))
t.start()
for x in range(20):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
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)