Exemplo n.º 1
0
        static void Main(string[] args)
        {
            PCS pcs = new PCS();

            TcpChannel channel = new TcpChannel(PCS._port);

            ChannelServices.RegisterChannel(channel, false);

            RemotingServices.Marshal(pcs, "PCS", typeof(IPCS));

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            int port = 11000;
            //System.Console.WriteLine("INSERT PORT:");
            //port = Int32.Parse(System.Console.ReadLine());
            TcpChannel channel = new TcpChannel(port);

            ChannelServices.RegisterChannel(channel, false);
            PCS pcs = new PCS();

            RemotingServices.Marshal(pcs, "PCS",
                                     typeof(PCS));
            System.Console.WriteLine("<enter> para sair ...");
            System.Console.ReadLine();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();

            provider.TypeFilterLevel = TypeFilterLevel.Full;
            IDictionary props = new Hashtable();

            props["port"] = ConnectionLibrary.PCS_PORT;
            TcpChannel channel = new TcpChannel(props, null, provider);

            ChannelServices.RegisterChannel(channel, false);

            PCS pcs = new PCS();

            RemotingServices.Marshal(pcs, ConnectionLibrary.PCS_NAME, typeof(PCS));
            // pcs.creatServerNode("asd", ":12000/", "4", "4");
            Console.WriteLine("----- PCS running -----");
            Console.ReadLine();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Usage: pcs.exe <server path> <client path>");
                return;
            }

            const int PCS_PORT = 10000;

            string serverPath = args[0];
            string clientPath = args[1];

            PCS pcs = new PCS(serverPath, clientPath);

            AppContext.SetSwitch(
                "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

            PCSService pcsService = new PCSService(pcs);

            Grpc.Core.Server server = new Grpc.Core.Server
            {
                Services =
                {
                    PCSGrpcService.BindService(pcsService)
                },
                Ports = { new ServerPort("0.0.0.0", PCS_PORT, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine("Press any key to stop PCS...");
            Console.ReadKey();

            server.ShutdownAsync().Wait();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            TcpChannel channel;
            PCS        pcs;

            if (args.Count() > 0)
            {
                channel = new TcpChannel(10000);
                pcs     = new PCS(args[0]);
            }
            else
            {
                channel = new TcpChannel(10000);
                pcs     = new PCS("XL");
            }
            ChannelServices.RegisterChannel(channel, false);

            RemotingServices.Marshal(pcs, "pcs", typeof(PCS));

            System.Console.WriteLine("Process Creation Service Started!");
            System.Console.WriteLine("---------------");
            System.Console.WriteLine("<Enter> to exit...");
            System.Console.ReadLine();
        }
Exemplo n.º 6
0
 public PCSService(PCS pcs)
 {
     Pcs = pcs;
 }