Exemplo n.º 1
0
        static void Main(string[] args)
        {
            CopierImplementation implementation;

            if (args.Length > 0 && !String.IsNullOrEmpty(args[0]))
            {
                CopierImplementationMode mode = Enum.Parse <CopierImplementationMode>(args[0]);
                implementation = new CopierImplementation(mode);
            }
            else
            {
                implementation = new CopierImplementation();
            }

            ChannelOption[] options = new ChannelOption[] {  };
            Server          server  = new Server(options)
            {
                Services = { Copier.BindService(implementation) },
                Ports    = { new ServerPort("localhost", CopyConstants.PortNumber, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine("Listening");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            CopierImplementation implementation = new CopierImplementation();

            ChannelOption[] options = new ChannelOption[] {  };
            Server          server  = new Server(options)
            {
                Services = { Copier.BindService(implementation) },
                Ports    = { new ServerPort("localhost", CopyConstants.PortNumber, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine("Listening");
            Console.ReadLine();
        }