提交 b3d98c4a 编写于 作者: B Bret Taylor

Add basic error checking so you can't add a server to the IOLoop twice

上级 8d4dde80
......@@ -113,6 +113,7 @@ class HTTPServer(object):
self.xheaders = xheaders
self.ssl_options = ssl_options
self._socket = None
self._started = False
def listen(self, port, address=""):
"""Binds to the given port and starts the server in a single process.
......@@ -156,6 +157,8 @@ class HTTPServer(object):
Since we run use processes and not threads, there is no shared memory
between any server code.
"""
assert not self._started
self._started = True
if num_processes is None:
# Use sysconf to detect the number of CPUs (cores)
try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册