public void Dispose() { CloseServerAction.Invoke(); GrpcServer.ShutdownAsync().Wait(); var port = GrpcServer.Ports.FirstOrDefault(); Console.WriteLine("Server closed ({0}:{1}).", Configuration.HOST, Configuration.PORT); }
static void GrpcServerStart() { using (var server = new GrpcServer(new Grpc.Core.Server { Services = { Greeter.BindService(new GreeterImpl()) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } })) { Console.WriteLine("Greeter server listening on port " + Port); Console.WriteLine("Press any key to stop the server..."); Console.ReadKey(); } }
public void Start() { GrpcServer.Start(); Console.WriteLine(string.Format("Server started ({0}:{1}).", Configuration.HOST, Configuration.PORT)); System.IO.StreamReader file = new System.IO.StreamReader(@"..\..\Zodii.txt"); string line; while ((line = file.ReadLine()) != null) { string[] words = line.Split(' '); listZodiacSigns.Add(new ZodiacSign(words[0], words[1], words[2], words[3], words[4])); } file.Close(); }
public void Start() { GrpcServer.Start(); Console.WriteLine(string.Format("Server started ({0}:{1}).", Configuration.HOST, Configuration.PORT)); }
static void Main(string[] args) { var server = new GrpcServer(); server.Host(); }