本文整理汇总了Python中twisted.application.internet.TCPServer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python TCPServer.__init__方法的具体用法?Python TCPServer.__init__怎么用?Python TCPServer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.application.internet.TCPServer
的用法示例。
在下文中一共展示了TCPServer.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, dbpool, services):
self.dbpool = dbpool
self.services = services
self.isRunning = False
port = services["config"]["flash-policy-port"]
factory = FlashPolicyFactory(services["config"])
TCPServer.__init__(self, port, factory)
示例2: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, env):
self.env = env
http_port = env.config.getint('web', 'http_port') or HTTP_PORT
log_file = env.config.get('web', 'http_log_file') or None
if not os.path.isabs(log_file):
log_file = os.path.join(self.env.config.path, log_file)
factory = WebServiceFactory(env, log_file)
TCPServer.__init__(self, http_port, factory)
示例3: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, dbpool, services, reactor = None):
## lazy import to avoid reactor install upon module import
if reactor is None:
from twisted.internet import reactor
self.reactor = reactor
self.dbpool = dbpool
self.services = services
self.isRunning = False
port = services["config"]["flash-policy-port"]
allowedPort = services["config"]["hub-websocket-port"]
factory = FlashPolicyFactory(allowedPort, reactor)
TCPServer.__init__(self, port, factory)
示例4: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, env):
self.env = env
port = env.config.getint('ssh', 'port')
TCPServer.__init__(self, port, SSHServiceFactory(env))
self.setName("SSH")
self.setServiceParent(env.app)
示例5: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, env):
self.env = env
port = env.config.getint("manhole", "port")
TCPServer.__init__(self, port, ManholeServiceFactory(env))
self.setName("Manhole")
self.setServiceParent(env.app)
示例6: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, port, backlog, ip_addr):
self.root = resource.Resource()
TCPServer.__init__(self, port, server.Site(self.root), backlog, interface=ip_addr)
示例7: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, port, ip_addr):
self.root = self.create_site()
self.port = port
TCPServer.__init__(self, port, server.Site(self.root), 100, interface=ip_addr)
示例8: __init__
# 需要导入模块: from twisted.application.internet import TCPServer [as 别名]
# 或者: from twisted.application.internet.TCPServer import __init__ [as 别名]
def __init__(self, port = 80):
TCPServer.__init__(self, port, frontFactory)