Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Server server = new Server
            {
                Services = { Calculate.BindService(new CalculatorImpl()) },
                Ports    = { new ServerPort("localhost", Port, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine("Simple calculator server listening on port " + Port);
            Console.WriteLine("Press any key to stop the server...");
            Console.ReadKey();

            server.ShutdownAsync().Wait();
        }