/// <summary> /// Returns the list of gateways (silos) that can be used by a client to connect to Orleans cluster. /// The Uri is in the form of: "gwy.tcp://IP:port/Generation". See Utils.ToGatewayUri and Utils.ToSiloAddress for more details about Uri format. /// </summary> public async Task <IList <Uri> > GetGateways() { var membershipTableData = await ZooKeeperBasedMembershipTable.ReadAll(this.deploymentConnectionString, this.watcher); return(membershipTableData.Members.Select(e => e.Item1). Where(m => m.Status == SiloStatus.Active && m.ProxyPort != 0). Select(m => { m.SiloAddress.Endpoint.Port = m.ProxyPort; return m.SiloAddress.ToGatewayUri(); }).ToList()); }
/// <summary> /// Returns the list of gateways (silos) that can be used by a client to connect to Orleans cluster. /// The Uri is in the form of: "gwy.tcp://IP:port/Generation". See Utils.ToGatewayUri and Utils.ToSiloAddress for more details about Uri format. /// </summary> public async Task <IList <Uri> > GetGateways() { var membershipTableData = await ZooKeeperBasedMembershipTable.ReadAll(this.deploymentConnectionString, this.watcher); return(membershipTableData.Members.Select(e => e.Item1). Where(m => m.Status == SiloStatus.Active && m.ProxyPort != 0). Select(m => { var endpoint = new IPEndPoint(m.SiloAddress.Endpoint.Address, m.ProxyPort); var gatewayAddress = SiloAddress.New(endpoint, m.SiloAddress.Generation); return gatewayAddress.ToGatewayUri(); }).ToList()); }