예제 #1
0
        public void StandIn_to_Host()
        {
            using(var host = new WcfHostTransceiver("localhost:8000"))
            using (var standIn = new WcfStandInTransceiver("localhost:8001", "localhost:8000"))
            {
                HostInput input = null;
                host.ReceivedFromStandIn += _ => input = _;

                standIn.SendToHost(new HostInput {Data = new byte[]{4,2}});

                Assert.AreEqual(new byte[]{4,2}, input.Data);
            }
        }
예제 #2
0
        public void Host_to_StandIn()
        {
            using (var host = new WcfHostTransceiver("localhost:8000"))
            using (var standIn = new WcfStandInTransceiver("localhost:8001", "localhost:8000"))
            {
                HostOutput output = null;
                standIn.ReceivedFromHost += _ => output = _;

                host.SendToStandIn(new Tuple<string, HostOutput>("localhost:8001", new HostOutput{Data = new byte[]{4,2}}));

                Assert.AreEqual(new byte[]{4,2}, output.Data);
            }
        }
예제 #3
0
        public void StandIn_to_Host()
        {
            using (var host = new WcfHostTransceiver("localhost:8000"))
                using (var standIn = new WcfStandInTransceiver("localhost:8001", "localhost:8000"))
                {
                    HostInput input = null;
                    host.ReceivedFromStandIn += _ => input = _;

                    standIn.SendToHost(new HostInput {
                        Data = new byte[] { 4, 2 }
                    });

                    Assert.AreEqual(new byte[] { 4, 2 }, input.Data);
                }
        }
예제 #4
0
        public void Host_to_StandIn()
        {
            using (var host = new WcfHostTransceiver("localhost:8000"))
                using (var standIn = new WcfStandInTransceiver("localhost:8001", "localhost:8000"))
                {
                    HostOutput output = null;
                    standIn.ReceivedFromHost += _ => output = _;

                    host.SendToStandIn(new Tuple <string, HostOutput>("localhost:8001", new HostOutput {
                        Data = new byte[] { 4, 2 }
                    }));

                    Assert.AreEqual(new byte[] { 4, 2 }, output.Data);
                }
        }
예제 #5
0
        public WcfStandInOperation(string name, string standInEndpointAddress, string remoteEndpointAddress) : base(name)
        {
            var transceiver = new WcfStandInTransceiver(standInEndpointAddress, remoteEndpointAddress);

            _standInOperation = new StandInOperation(name, transceiver, transceiver);
        }