Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f77344bc
Commit
f77344bc
authored
Apr 30, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport of former medusa patches
parent
0713f9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
18 deletions
+14
-18
ZServer/medusa/test/max_sockets.py
ZServer/medusa/test/max_sockets.py
+7
-9
lib/python/ZServer/medusa/test/max_sockets.py
lib/python/ZServer/medusa/test/max_sockets.py
+7
-9
No files found.
ZServer/medusa/test/max_sockets.py
View file @
f77344bc
# -*- Mode: Python; tab-width: 4 -*-
import
socket
import
select
...
...
@@ -50,18 +49,17 @@ def max_select_sockets():
sl
=
[]
while
1
:
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
bind
((
''
,
0
))
s
.
listen
(
5
)
sl
.
append
(
s
)
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
)
sl
.
append
(
s
)
select
.
select
(
sl
,[],[],
0
)
except
:
break
num
=
len
(
sl
)
-
1
for
s
in
sl
:
s
.
close
()
del
sl
return
num
lib/python/ZServer/medusa/test/max_sockets.py
View file @
f77344bc
# -*- Mode: Python; tab-width: 4 -*-
import
socket
import
select
...
...
@@ -50,18 +49,17 @@ def max_select_sockets():
sl
=
[]
while
1
:
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
bind
((
''
,
0
))
s
.
listen
(
5
)
sl
.
append
(
s
)
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
)
sl
.
append
(
s
)
select
.
select
(
sl
,[],[],
0
)
except
:
break
num
=
len
(
sl
)
-
1
for
s
in
sl
:
s
.
close
()
del
sl
return
num
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment