Exemple #1
0
        public void Setup()
        {
            //EneterTrace.DetailLevel = EneterTrace.EDetailLevel.Debug;
            //EneterTrace.TraceLog = new StreamWriter("d:/tracefile.txt");
            //EneterTrace.StartProfiler();


            // Generate random number for the port.
            string aPort = RandomPortGenerator.Generate();

            TcpMessagingSystemFactory anUnderlyingMessaging = new TcpMessagingSystemFactory();

            //ChannelId = "tcp://127.0.0.1:" + aPort + "/";
            ChannelId = "tcp://[::1]:" + aPort + "/";

            MessagingSystemFactory = new AuthenticatedMessagingFactory(anUnderlyingMessaging,
                                                                       GetLoginMessage,
                                                                       GetHandshakeResponseMessage,
                                                                       GetHandshakeMessage, VerifyHandshakeResponseMessage, HandleAuthenticationCancelled)
            {
                AuthenticationTimeout = TimeSpan.FromMilliseconds(2000)
            };

            myHandshakeSerializer = new AesSerializer("Password123");
        }
        public void Setup()
        {
            //EneterTrace.DetailLevel = EneterTrace.EDetailLevel.Debug;
            //EneterTrace.TraceLog = new StreamWriter("d:/tracefile.txt");

            // Generate random number for the port.
            int aPort1 = RandomPortGenerator.GenerateInt();
            int aPort2 = aPort1 + 10;

            IMessagingSystemFactory anUnderlyingMessaging = new SharedMemoryMessagingSystemFactory();

            IDuplexInputChannel aMessageBusServiceInputChannel = anUnderlyingMessaging.CreateDuplexInputChannel("MyServicesAddress");
            IDuplexInputChannel aMessageBusClientInputChannel  = anUnderlyingMessaging.CreateDuplexInputChannel("MyClientsAddress");

            myMessageBus = new MessageBusFactory().CreateMessageBus();
            myMessageBus.AttachDuplexInputChannels(aMessageBusServiceInputChannel, aMessageBusClientInputChannel);

            MessagingSystemFactory = new MessageBusMessagingFactory("MyServicesAddress", "MyClientsAddress", anUnderlyingMessaging)
            {
                ConnectTimeout = TimeSpan.FromMilliseconds(3000)
            };

            // Address of the service in the message bus.
            ChannelId = "Service1_Address";
        }
Exemple #3
0
        public void Setup()
        {
            //EneterTrace.DetailLevel = EneterTrace.EDetailLevel.Debug;
            //EneterTrace.TraceLog = new StreamWriter("d:/tracefile.txt");

            // Generate random number for the port.
            int aPort1 = RandomPortGenerator.GenerateInt();
            int aPort2 = aPort1 + 10;

            IMessagingSystemFactory anUnderlyingMessaging = new TcpMessagingSystemFactory(new EasyProtocolFormatter());

            IDuplexInputChannel aMessageBusServiceInputChannel = anUnderlyingMessaging.CreateDuplexInputChannel("tcp://[::1]:" + aPort1 + "/");
            IDuplexInputChannel aMessageBusClientInputChannel  = anUnderlyingMessaging.CreateDuplexInputChannel("tcp://[::1]:" + aPort2 + "/");

            myMessageBus = new MessageBusFactory().CreateMessageBus();
            myMessageBus.AttachDuplexInputChannels(aMessageBusServiceInputChannel, aMessageBusClientInputChannel);

            MessagingSystemFactory = new MessageBusMessagingFactory("tcp://[::1]:" + aPort1 + "/", "tcp://[::1]:" + aPort2 + "/", anUnderlyingMessaging)
            {
                ConnectTimeout = TimeSpan.FromMilliseconds(3000)
            };

            // Address of the service in the message bus.
            ChannelId = "Service1_Address";

            CompareResponseReceiverId = false;
        }
Exemple #4
0
        public void ReleasePort()
        {
            if (!_port.HasValue)
            {
                return;
            }

            RandomPortGenerator.TryReleasePort(_port.Value);
            _port = null;
        }
        public void Setup()
        {
            string aPort     = RandomPortGenerator.Generate();
            string anAddress = "tcp://127.0.0.1:" + aPort + "/";

            IMessagingSystemFactory aMessaging = new TcpMessagingSystemFactory();

            InputChannel  = aMessaging.CreateDuplexInputChannel(anAddress);
            OutputChannel = aMessaging.CreateDuplexOutputChannel(anAddress);

            DuplexTypedMessagesFactory = new DuplexTypedMessagesFactory();
        }
Exemple #6
0
        public void Setup()
        {
            //EneterTrace.DetailLevel = EneterTrace.EDetailLevel.Debug;
            //EneterTrace.TraceLog = new StreamWriter("d:/tracefile.txt");
            //EneterTrace.StartProfiler();

            // Generate random number for the port.
            string aPort = RandomPortGenerator.Generate();

            MessagingSystemFactory = new TcpMessagingSystemFactory();
            //ChannelId = "tcp://127.0.0.1:" + aPort + "/";
            ChannelId = "tcp://[::1]:" + aPort + "/";
        }
        public void Setup()
        {
            //EneterTrace.DetailLevel = EneterTrace.EDetailLevel.Debug;
            //EneterTrace.TraceLog = new StreamWriter("d:/tracefile.txt");
            //EneterTrace.StartProfiler();

            // Generate random number for the port.
            string aPort = RandomPortGenerator.Generate();

            MessagingSystemFactory = new WebSocketMessagingSystemFactory(new EasyProtocolFormatter());
            ChannelId = "ws://127.0.0.1:" + aPort + "/";

            this.CompareResponseReceiverId = false;
            this.myRequestMessage          = new byte[] { (byte)'M', (byte)'E', (byte)'S', (byte)'S', (byte)'A', (byte)'G', (byte)'E' };
            this.myResponseMessage         = new byte[] { (byte)'R', (byte)'E', (byte)'S', (byte)'P', (byte)'O', (byte)'N', (byte)'S', (byte)'E' };
            this.myMessage_10MB            = RandomDataGenerator.GetBytes(10000000);
        }