本文整理汇总了Python中socketserver.UnixStreamServer方法的典型用法代码示例。如果您正苦于以下问题:Python socketserver.UnixStreamServer方法的具体用法?Python socketserver.UnixStreamServer怎么用?Python socketserver.UnixStreamServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类socketserver
的用法示例。
在下文中一共展示了socketserver.UnixStreamServer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import socketserver [as 别名]
# 或者: from socketserver import UnixStreamServer [as 别名]
def __init__(self, selector, listen_address, clients, known_devices):
self.clients = clients
if isinstance(listen_address, int) or listen_address.isnumeric():
s_addr = ('localhost', int(listen_address))
socketserver.TCPServer.allow_reuse_address = True
s = socketserver.TCPServer(s_addr, ApiRequestHandler)
else:
s = socketserver.UnixStreamServer(
listen_address, ApiRequestHandler)
# quiet hacky
s.wsd_clients = clients
s.wsd_known_devices = known_devices
selector.register(s.fileno(), selectors.EVENT_READ, s)
示例2: server_bind
# 需要导入模块: import socketserver [as 别名]
# 或者: from socketserver import UnixStreamServer [as 别名]
def server_bind(self):
socketserver.UnixStreamServer.server_bind(self)
self.server_name = '127.0.0.1'
self.server_port = 80
示例3: test_UnixStreamServer
# 需要导入模块: import socketserver [as 别名]
# 或者: from socketserver import UnixStreamServer [as 别名]
def test_UnixStreamServer(self):
self.run_server(socketserver.UnixStreamServer,
socketserver.StreamRequestHandler,
self.stream_examine)
示例4: __init__
# 需要导入模块: import socketserver [as 别名]
# 或者: from socketserver import UnixStreamServer [as 别名]
def __init__(self, *args, **kwargs):
self.logger = create_logger(kwargs.pop('logger', None))
self.tunnel_ok = queue.Queue()
UnixStreamServer.__init__(self, *args, **kwargs)