Exemplo n.º 1
0
        public void Dispose()
        {
            CloseServerAction.Invoke();
            GrpcServer.ShutdownAsync().Wait();
            var port = GrpcServer.Ports.FirstOrDefault();

            Console.WriteLine("Server closed ({0}:{1}).", Configuration.HOST, Configuration.PORT);
        }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        public void Start()
        {
            GrpcServer.Start();

            Console.WriteLine(string.Format("Server started ({0}:{1}).", Configuration.HOST, Configuration.PORT));
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            var server = new GrpcServer();

            server.Host();
        }