Beispiel #1
0
        public async Task remote_rpc_should_work()
        {
            var host   = this.CreateWebHost();
            var client = AppDomainHelper.Create("test1").GetProxy <TestClient>();

            client.Start(2535);
            await host.StartAsync();

            var bus = host.Services.GetService <IBus>();

            //await bus.ProtoRegister<MTReqPq>(true,subs =>
            //{
            //	subs.Handler = x => {

            //		return Task.FromResult<object>(new MTReqDhParams {
            //			Nonce = new Org.BouncyCastle.Math.BigInteger(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, }),
            //			EncryptedData = new byte[] { 1, 2, 3 },
            //			P = new byte[] { 1, 2, 3 },
            //			PublicKeyFingerprint = 0,
            //			Q = new byte[] { 1, 2, 3 },
            //			ServerNonce = new Org.BouncyCastle.Math.BigInteger( new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, })
            //		}) ;
            //	};

            //});

            var req = new MTReqPq()
            {
                Nonce = new Org.BouncyCastle.Math.BigInteger("12332432543546546456456546456456456456", 10)
            };


            var context = MessageContext.Create(req);

            var reply = await bus.SendProto(message : context, mode : SendModes.ExternalOnly);

            //var obj = reply.B.GetMessage();
            var f = reply.Body;



            await host.StopAsync();

            await Task.Delay(10 * 60 * 1000);
        }