Example #1
0
        static void Main()
        {
            // Enable Support For Unencrypted HTTP2
            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            ParseArgs();
            var hp = Lib.ParseURL(URL);

            Grpc.Core.Server server = new Grpc.Core.Server {
                Services =
                {
                    PupSyncServices.BindService(new PupSyncServicesImpl())
                },
                Ports = { new ServerPort(hp[0], Convert.ToInt16(hp[1]), ServerCredentials.Insecure) }
            };
            server.Start();

            try {
                exec.Run();
            } catch (Exception e) when(e is OverflowException || e is FormatException)
            {
                Lib.Exit("Invalid Argument!");
            } catch (ClientException e) {
                Lib.Exit(e.Message);
            }
            Lib.Block(URL);
        }
Example #2
0
        static void Main()
        {
            // Enable Support For Unencrypted HTTP2
            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            ParseArgs();

            var hp    = Lib.ParseURL(URL);
            var store = new ServerDomain();

            Grpc.Core.Server server = new Grpc.Core.Server {
                Services =
                {
                    GStoreServices.BindService(new GStoreServicesImpl(store,   man, minDelay, maxDelay)),
                    GStoreSync.BindService(new GStoreSyncImpl(store,           man, minDelay, maxDelay)),
                    PupSyncServices.BindService(new PupSyncServicesImpl(store, man))
                },
                Ports = { new ServerPort(hp[0], Convert.ToInt16(hp[1]), ServerCredentials.Insecure) }
            };
            server.Start();
            Lib.Block(URL);
        }