コード例 #1
0
ファイル: Program.cs プロジェクト: SkyWriter/transaqgrpc
        public static void Main(string[] args)
        {
            XmlConnector.Path = args.Length == 0 ? Directory.GetCurrentDirectory() : args[0];

            var transaqConnectorImpl = new TransaqConnectorImpl();
            var server = new Server
            {
                Services = { TransaqConnector.BindService(transaqConnectorImpl) },
                Ports    = { new ServerPort("0.0.0.0", Port, ServerCredentials.Insecure) }
            };

            XmlConnector.Init(str =>
            {
                transaqConnectorImpl.OnMsg(str);
                return(str);
            });

            server.Start();

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

            server.ShutdownAsync().Wait();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: rozhkovdmitrii/transaqgrpc
        public static void Main(string[] args)
        {
            XmlConnector.Path = args.Length == 0 ? Directory.GetCurrentDirectory() : args[0];

            var cacert         = File.ReadAllText(@"/keys/ca.crt");
            var servercert     = File.ReadAllText(@"/keys/server.crt");
            var serverkey      = File.ReadAllText(@"/keys/server.key");
            var keypair        = new KeyCertificatePair(servercert, serverkey);
            var sslCredentials = new SslServerCredentials(new List <KeyCertificatePair>()
            {
                keypair
            }, cacert, false);


            var transaqConnectorImpl = new TransaqConnectorImpl();
            var server = new Server
            {
                Services = { TransaqConnector.BindService(transaqConnectorImpl) },
                Ports    = { new ServerPort("0.0.0.0", Port, sslCredentials) }
            };

            XmlConnector.Init(str =>
            {
                transaqConnectorImpl.OnMsg(str);
                return(str);
            });

            server.Start();

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

            server.ShutdownAsync().Wait();
        }
コード例 #3
0
        public ShellViewModel()
        {
            this.transaqConnector = new TransaqConnector();

            this.Title = StockTraderTransaq.Properties.Resources.Title;

            this.IsContentGridVisible = false;

            this.IsSideGridVisible = false;

            this.ConfirmationRequest = new InteractionRequest <IConfirmation>();
            this.NotificationRequest = new InteractionRequest <INotification>();

            this.LoginRequest   = new InteractionRequest <LoginViewModel>();
            this.LoadingRequest = new InteractionRequest <LoadingViewModel>();

            // Commands for each of the buttons. Each of these raise a different interaction request.
            this.RaiseAboutCommand    = new DelegateCommand(this.OnAbout);
            this.RaiseCloseCommand    = new DelegateCommand(this.OnClose);
            this.RaiseMinimizeCommand = new DelegateCommand(this.OnMinimize);

            this.LoadedCommand = new DelegateCommand <RoutedEventArgs>(this.OnLoaded);
        }