当前位置: 首页>>代码示例>>Python>>正文


Python StreamServerEndpointService.__init__方法代码示例

本文整理汇总了Python中twisted.application.internet.StreamServerEndpointService.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python StreamServerEndpointService.__init__方法的具体用法?Python StreamServerEndpointService.__init__怎么用?Python StreamServerEndpointService.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.application.internet.StreamServerEndpointService的用法示例。


在下文中一共展示了StreamServerEndpointService.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from twisted.application.internet import StreamServerEndpointService [as 别名]
# 或者: from twisted.application.internet.StreamServerEndpointService import __init__ [as 别名]
 def __init__(self, device):
     '''
     Initialization of UPnP server
     '''
     self.upnp = UPnP(device)
     self.device = device
     self.upnp.parent = self
     self.site = server.Site(self.upnp)
     edp = endpoints.serverFromString(reactor, "tcp:0")
     StreamServerEndpointService.__init__(self, edp, self.site)
     self._choosenPort = None
开发者ID:bverdu,项目名称:onDemand,代码行数:13,代码来源:upnp_new.py

示例2: __init__

# 需要导入模块: from twisted.application.internet import StreamServerEndpointService [as 别名]
# 或者: from twisted.application.internet.StreamServerEndpointService import __init__ [as 别名]
    def __init__(self, res):
        '''
        Initialization of UPnP server
        '''
        self.resource = res
#         self.resource = static.File(
#             '/home/babe/Projets/eclipse/onDemand/src/web/')
        edp = endpoints.serverFromString(reactor, b'tcp:0')
        StreamServerEndpointService.__init__(
            self, edp, server.Site(self.resource))
        self._choosenPort = None
开发者ID:bverdu,项目名称:onDemand,代码行数:13,代码来源:webserver.py

示例3: __init__

# 需要导入模块: from twisted.application.internet import StreamServerEndpointService [as 别名]
# 或者: from twisted.application.internet.StreamServerEndpointService import __init__ [as 别名]
    def __init__(self, config):
        SimarglClient.__init__(self, config)

        from twisted.internet import reactor

        self.factory = SimarglServerFactory(self)

        StreamServerEndpointService.__init__(
            self,
            TCP4ServerEndpoint(reactor, int(config.get('port', 9666)), interface=config.get('host')),
            self.factory
        )
开发者ID:hitsl,项目名称:bouser_simargl,代码行数:14,代码来源:simargl_server.py

示例4: __init__

# 需要导入模块: from twisted.application.internet import StreamServerEndpointService [as 别名]
# 或者: from twisted.application.internet.StreamServerEndpointService import __init__ [as 别名]
 def __init__(self, device):
     '''
     Initialization of UPnP server
     '''
     self.upnp = UPnP(device)
     self.devices = [device]
     device.parent = self
     self.upnp.parent = self
     self.site = server.Site(self.upnp)
     edp = endpoints.serverFromString(reactor, "tcp:0")
     StreamServerEndpointService.__init__(self, edp, self.site)
     self._choosenPort = None
     for service in device.services:
         service.control_resource = TwistedWebResource(service.app)
         service.event_resource = ServiceEventResource(service)
         service.resource = ServiceResource(service)
开发者ID:bverdu,项目名称:onDemand,代码行数:18,代码来源:upnp.py

示例5: __init__

# 需要导入模块: from twisted.application.internet import StreamServerEndpointService [as 别名]
# 或者: from twisted.application.internet.StreamServerEndpointService import __init__ [as 别名]
 def __init__(self, debug, basedir, conf):
     '''
     Initialization of web and websocket servers
     '''
     self.playing = False
     self.conf = conf
     self.recording = False
     self.analysing = False
     self.serving = False
     self.opened = False
     self.analyzed = {}
     self.analyzed['cocktail'] = 0
     self.analyzed['result'] = ''
     self.port = str(conf.httpport)
     self.debug = debug
     self.langage = conf.langage
     self.dbsession = conf.dbsession
     self.inports = []
     self.outports = []
     self.sysports = [(0,0),(0,0)]
     self.page = Dispatcher(debug, basedir, conf)
     print("installdir= %s" % basedir)
     self.page.parent = self
     self.site = server.Site(self.page)
     self.site.protocol = HTTPChannelHixie76Aware
     if isinstance(conf.httpport, int):
         edp = endpoints.serverFromString(reactor, "tcp:"+str(conf.httpport))
     else:
         edp = endpoints.serverFromString(reactor, conf.httpport)
     StreamServerEndpointService.__init__(self, edp, self.site)
     self.wsfactory = SeqFactory(debug, self.endpoint._port)
     self.wsfactory.protocol = PyanoTCP
     self.wsfactory.setProtocolOptions(allowHixie76 = True)
     self.wsfactory.parent = self
     self.wsresource = WebSocketResource(self.wsfactory)
     self.page.putChild("ws", self.wsresource)
开发者ID:bverdu,项目名称:Pyanocktail,代码行数:38,代码来源:webServer.py


注:本文中的twisted.application.internet.StreamServerEndpointService.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。