Added test to check that child threads die when parent dies
This commit is contained in:
parent
6f12132e88
commit
0a5b069cdd
7 changed files with 193 additions and 137 deletions
17
serve_tests.py
Executable file → Normal file
17
serve_tests.py
Executable file → Normal file
|
|
@ -1,7 +1,14 @@
|
|||
'Launch this server in another terminal window before running tests'
|
||||
from socketio import socketio_manage
|
||||
from socketio.namespace import BaseNamespace
|
||||
from socketio.server import SocketIOServer
|
||||
import sys
|
||||
try:
|
||||
from socketio import socketio_manage
|
||||
from socketio.namespace import BaseNamespace
|
||||
from socketio.server import SocketIOServer
|
||||
except ImportError:
|
||||
from setuptools.command import easy_install
|
||||
easy_install.main(['-U', 'gevent-socketio'])
|
||||
print('\nPlease run the script again to launch the test server.')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
class Namespace(BaseNamespace):
|
||||
|
|
@ -25,5 +32,7 @@ class Application(object):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
socketIOServer = SocketIOServer(('0.0.0.0', 8000), Application())
|
||||
port = 8000
|
||||
print 'Starting server at port %s' % port
|
||||
socketIOServer = SocketIOServer(('0.0.0.0', port), Application())
|
||||
socketIOServer.serve_forever()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue