Skip to content

Commit

Permalink
Add auto start parameter to socket server
Browse files Browse the repository at this point in the history
  • Loading branch information
kachayev committed Oct 23, 2011
1 parent f61b83f commit c364054
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tornadio/server.py
Expand Up @@ -25,7 +25,8 @@ class SocketServer(HTTPServer):


def __init__(self, application, def __init__(self, application,
no_keep_alive=False, io_loop=None, no_keep_alive=False, io_loop=None,
xheaders=False, ssl_options=None xheaders=False, ssl_options=None,
auto_start=True
): ):
"""Initializes the server with the given request callback. """Initializes the server with the given request callback.
Expand Down Expand Up @@ -67,5 +68,9 @@ def __init__(self, application,
except Exception, ex: except Exception, ex:
logging.error('Failed to start Flash policy server: %s', ex) logging.error('Failed to start Flash policy server: %s', ex)


logging.info('Entering IOLoop...') # Set auto_start to False in order to have opportunities
io_loop.start() # to work with server object and/or perform some actions
# after server already created but before ioloop will start
if auto_start:
logging.info('Entering IOLoop...')
io_loop.start()

0 comments on commit c364054

Please sign in to comment.