def send(self, data): if self.client == None: ip = sbserver.ip() if ip != None: reactor.connectTCP(master_host, int(master_port), self, 30, (sbserver.ip(), sbserver.port())) else: reactor.connectTCP(master_host, int(master_port), self) self.send_buffer.append(data) else: self.client.sendLine(data)
def registerServer(): factory.response_handler.responses_needed += 1 factory.send('regserv %i' % sbserver.port())
def port(): '''Port server is bound to.''' return sbserver.port()