예제 #1
0
 def startService(self, main):
     ifactory = IRCFactory(main)
     bind = (getBindIP(), 0)
     if self.ssl:
         from twisted.internet import ssl
         sslContext = ssl.ClientContextFactory()
         reactor.connectSSL(
             self.host, self.port, ifactory, sslContext, bindAddress=bind)
     else:
         reactor.connectTCP(self.host, self.port, ifactory, bindAddress=bind)
예제 #2
0
파일: main.py 프로젝트: Achilles-96/dtella
 def startConnecting(self):
     udp_state = self.ph.getSocketState()
     if udp_state == 'dead':
         bind_ip = bridge_server.getBindIP()
         try:
             reactor.listenUDP(cfg.udp_port, self.ph, interface=bind_ip)
         except twisted.internet.error.BindError:
             LOG.error("Failed to bind UDP port!")
             raise SystemExit
     elif udp_state == 'dying':
         return
     
     CHECK(self.ph.getSocketState() == 'alive')
     self.startInitialContact()
예제 #3
0
    def startConnecting(self):
        udp_state = self.ph.getSocketState()
        if udp_state == 'dead':
            bind_ip = bridge_server.getBindIP()
            try:
                reactor.listenUDP(cfg.udp_port, self.ph, interface=bind_ip)
            except twisted.internet.error.BindError:
                LOG.error("Failed to bind UDP port!")
                raise SystemExit
        elif udp_state == 'dying':
            return

        CHECK(self.ph.getSocketState() == 'alive')
        self.startInitialContact()
예제 #4
0
 def startService(self, main):
     ifactory = IRCFactory(main)
     bind = (getBindIP(), 0)
     if self.ssl:
         from twisted.internet import ssl
         sslContext = ssl.ClientContextFactory()
         reactor.connectSSL(self.host,
                            self.port,
                            ifactory,
                            sslContext,
                            bindAddress=bind)
     else:
         reactor.connectTCP(self.host,
                            self.port,
                            ifactory,
                            bindAddress=bind)