예제 #1
0
        public Task <string> OpenAsync(CancellationToken cancellationToken)
        {
            var endpoint = FabricRuntime.GetActivationContext().
                           GetEndpoint("ServiceEndpoint");

            _grpcServer = new Server
            {
                Services = { CaesarCipher.BindService
                                 (new CaesarCipherServiceImpl(_replicaId)) },
                Ports = { new ServerPort(endpoint.IpAddressOrFqdn, endpoint.Port,
                                         ServerCredentials.Insecure) }
            };
            _grpcServer.Start();
            return(Task.FromResult <string>(endpoint.IpAddressOrFqdn + ":"
                                            + endpoint.Port.ToString()));
        }