當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。