本文整理汇总了Python中SocketServer.TCPServer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python TCPServer.__init__方法的具体用法?Python TCPServer.__init__怎么用?Python TCPServer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SocketServer.TCPServer
的用法示例。
在下文中一共展示了TCPServer.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, server_address, stop_event, RequestHandlerClass):
HTTPServer.__init__(self, server_address, RequestHandlerClass)
self._stop_event = stop_event
self.auth_code = None
示例2: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, port, host='127.0.0.1', loglevel=logging.WARNING):
logger.setLevel(loglevel)
self.port = port
TCPServer.__init__(self, (host, port), WebSocketHandler)
示例3: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, server_address):
"""Initialization of CacheTCPServer"""
common.info('Constructing CacheTCPServer')
TCPServer.__init__(self, server_address, NetflixHttpRequestHandler)
示例4: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, server_address):
"""Initialization of MSLTCPServer"""
common.info('Constructing NetflixTCPServer')
self.netflix_session = NetflixSession()
TCPServer.__init__(self, server_address, NetflixHttpRequestHandler)
示例5: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, server_address):
"""Initialization of MSLTCPServer"""
common.info('Constructing MSLTCPServer')
self.msl_handler = MSLHandler()
TCPServer.__init__(self, server_address, MSLHttpRequestHandler)
示例6: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, port, host='127.0.0.1', loglevel=logging.WARNING):
logger.setLevel(loglevel)
TCPServer.__init__(self, (host, port), WebSocketHandler)
self.port = self.socket.getsockname()[1]
示例7: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, content_object=None, content_provider_class=ContentProvider):
self.content_provider = content_provider_class(content_object)
TCPServer.__init__(self, ("127.0.0.1", 0), SFTPRequestHandler, False)
Thread.__init__(self)
self.daemon = True
self._bound = Event()
示例8: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self):
pass
示例9: start
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def start(self):
TCPServer.__init__(self, ('localhost', int(HTTP_PORT)), CustomHandler)
self.RESOURCE_LOCATION = path.abspath(path.dirname(__file__))
print("Server serving from DocumentRoot:" + self.RESOURCE_LOCATION)
chdir(self.RESOURCE_LOCATION)
server_thread = threading.Thread(name='test_file_server', target=self.serve_forever)
server_thread.daemon = True
server_thread.start()
示例10: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, socket, local):
telnetlib.Telnet.__init__(self)
self.sock = socket
self.remote = self.sock.fileno()
self.local = local
self.set_option_negotiation_callback(self.process_IAC)
示例11: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, server_address, nx_common):
"""Initializes NetflixTCPServer"""
nx_common.log(msg='Constructing netflixTCPServer')
netflix_session = NetflixSession(
cookie_path=nx_common.cookie_path,
data_path=nx_common.data_path,
verify_ssl=(nx_common.get_setting('ssl_verification') == 'true'),
nx_common=nx_common)
self.res_handler = NetflixHttpSubRessourceHandler(
nx_common=nx_common,
netflix_session=netflix_session)
TCPServer.__init__(self, server_address, NetflixHttpRequestHandler)
示例12: __init__
# 需要导入模块: from SocketServer import TCPServer [as 别名]
# 或者: from SocketServer.TCPServer import __init__ [as 别名]
def __init__(self, server_address, nx_common):
"""Initialization of MSLTCPServer"""
nx_common.log(msg='Constructing MSLTCPServer')
self.nx_common = nx_common
self.msl_handler = MSL(nx_common)
TCPServer.__init__(self, server_address, MSLHttpRequestHandler)