Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
gevent
Commits
74e51db4
Commit
74e51db4
authored
Sep 08, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gevent.wsgi.WSGIServer that is compatible with gevent.wsgi2.WSGIServer
parent
0b0e56ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
gevent/wsgi.py
gevent/wsgi.py
+24
-0
No files found.
gevent/wsgi.py
View file @
74e51db4
...
...
@@ -30,6 +30,7 @@ from urllib import unquote
from
gevent
import
socket
import
BaseHTTPServer
from
gevent.pool
import
Pool
from
gevent.greenlet
import
Greenlet
DEFAULT_MAX_SIMULTANEOUS_REQUESTS
=
1024
...
...
@@ -419,3 +420,26 @@ def server(sock, site, log=None, environ=None, max_size=None, max_http_version=D
if
e
[
0
]
!=
errno
.
EPIPE
:
traceback
.
print_exc
()
# compatibilty with wsgi2 module, for tests
class
WSGIServer
(
object
):
def
__init__
(
self
,
address
,
application
):
self
.
address
=
address
self
.
application
=
application
@
property
def
server_port
(
self
):
return
self
.
address
[
1
]
def
start
(
self
):
self
.
socket
=
socket
.
tcp_listener
(
self
.
address
)
self
.
address
=
self
.
socket
.
getsockname
()
self
.
server
=
Greenlet
.
spawn
(
server
,
self
.
socket
,
self
.
application
)
def
stop
(
self
):
self
.
server
.
kill
(
KeyboardInterrupt
)
self
.
socket
.
close
()
self
.
server
.
join
()
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