本文整理汇总了Python中wsgiref.simple_server.WSGIServer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python WSGIServer.__init__方法的具体用法?Python WSGIServer.__init__怎么用?Python WSGIServer.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wsgiref.simple_server.WSGIServer
的用法示例。
在下文中一共展示了WSGIServer.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, machine_id, host, port, ui):
self.machine_id = machine_id
WSGIServer.__init__(self, (host, port), WSGIRequestHandler)
self.set_app(self.wsgi_app)
Partner.__init__(self, ui)
self.text_format = XMLFormat()
self.stopped = False
self.sessions = {} # {session_token: session}
self.session_token_for_user = {} # {user_name: session_token}
示例2: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, *args, **kwargs):
WSGIServer.__init__(self, *args, **kwargs)
# NonBlockingClient -> timestamp
self.clients = {}
# Number of simultaneous clients.
self.limit = 1000
# Number of seconds before we bounce idle clients.
self.timeout = 60
self._shutdown_event = threading.Event()
示例3: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, server_address, HandlerClass):
WSGIServer.__init__(self, server_address, HandlerClass)
if self.cert_file:
ctx = SSL.Context(SSL.SSLv3_METHOD)
ctx.use_privatekey_file(self.cert_file)
ctx.use_certificate_file(self.cert_file)
self.socket = SSL.Connection(ctx, socket.socket(self.address_family,
self.socket_type))
self.server_bind()
self.server_activate()
示例4: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, *args, **kwargs):
for (k, d) in (('address_family', AF_INET), ('wsgi_env', {})):
setattr(self, k, kwargs.pop(k, d))
WSGIServer.__init__(self, *args, **kwargs)
示例5: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, server_address, app = None, RequestHandlerClass = WSGIRequestHandler):
_WSGIServer.__init__(self, server_address, RequestHandlerClass)
self.set_app(app)
示例6: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, *args, **kwargs):
WSGIServer.__init__(self, *args, **kwargs)
SimpleXMLRPCDispatcher.__init__(self, False, None)
示例7: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, thread_count=None, *args, **kwargs):
'''If 'thread_count' == None, we'll use multiprocessing.cpu_count() threads.'''
WSGIServer.__init__(self, *args, **kwargs)
self.thread_count = thread_count
self.pool = multiprocessing.pool.ThreadPool(self.thread_count)
示例8: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, family, address, handler):
self.address_family = family
if family == socket.AF_UNIX:
self.csize = struct.calcsize('3i')
self.get_request = self.get_unix_request
WSGIServer.__init__(self, address, handler)
示例9: __init__
# 需要导入模块: from wsgiref.simple_server import WSGIServer [as 别名]
# 或者: from wsgiref.simple_server.WSGIServer import __init__ [as 别名]
def __init__(self, host, port, buffers):
WSGIServer.__init__(self, (host, port), WSGIRequestHandler)
self.buffers = buffers
self.set_app(self.main)