Exemplo n.º 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)
Exemplo n.º 2
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()
Exemplo n.º 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()
Exemplo n.º 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)