Commit f77344bc authored by Andreas Jung's avatar Andreas Jung

backport of former medusa patches

parent 0713f9b8
# -*- Mode: Python; tab-width: 4 -*-
import socket
import select
......@@ -50,6 +49,9 @@ def max_select_sockets():
sl = []
while 1:
try:
num = len(sl)
for i in range(1 + len(sl) * 0.05):
# Increase exponentially.
s = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
s.bind (('',0))
s.listen(5)
......@@ -57,11 +59,7 @@ def max_select_sockets():
select.select(sl,[],[],0)
except:
break
num = len(sl) - 1
for s in sl:
s.close()
del sl
return num
# -*- Mode: Python; tab-width: 4 -*-
import socket
import select
......@@ -50,6 +49,9 @@ def max_select_sockets():
sl = []
while 1:
try:
num = len(sl)
for i in range(1 + len(sl) * 0.05):
# Increase exponentially.
s = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
s.bind (('',0))
s.listen(5)
......@@ -57,11 +59,7 @@ def max_select_sockets():
select.select(sl,[],[],0)
except:
break
num = len(sl) - 1
for s in sl:
s.close()
del sl
return num
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