Commit 1dc79c3f authored by Shane Hathaway's avatar Shane Hathaway

Collector 1260 - major speedup in start time.

parent a162eccc
......@@ -50,6 +50,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 +60,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
......@@ -50,6 +50,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 +60,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