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)
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()
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)