def METHOD_NAME(self, server, logical_port=None, sr_routing=False):
    self.ensureClassVariables()
    server.ensure_connected()
    self.open_servers.append(server)
    if sr_routing:
            self.open_ports_sr.append(server.get_secondary_port())
    else:
        if server.getsslport() is not None:
            self.open_ports.append(server.getsslport())
        else:
            self.open_ports.append(server.getport())
    if logical_port:
        if 'port_map' not in self.__dict__:
            self.port_map = {}
        if logical_port in self.port_map:
            raise Exception("logical_port %d was already used"
                            % logical_port)
        self.port_map[logical_port] = server.getport()
    return server