Esempio n. 1
0
 def __init__(self, listener, application=None, backlog=None, spawn='default', log='default', handler_class=None,
              environ=None, **ssl_args):
     StreamServer.__init__(self, listener, backlog=backlog, spawn=spawn, **ssl_args)
     if application is not None:
         self.application = application
     if handler_class is not None:
         self.handler_class = handler_class
     if log == 'default':
         self.log = sys.stderr
     else:
         self.log = log
     self.set_environ(environ)
Esempio n. 2
0
 def pre_start(self):
     StreamServer.pre_start(self)
     if 'SERVER_NAME' not in self.environ:
         self.environ['SERVER_NAME'] = socket.getfqdn(self.server_host)
     self.environ.setdefault('SERVER_PORT', str(self.server_port))