Ejemplo n.º 1
0
 public LocalSocket()
 {
     dataAvailable  = new ManualResetEvent(false);
     socketIdentity = ReceiverIdentifier.Create();
     messageQueue   = new BlockingCollection <T>(new ConcurrentQueue <T>());
     lookAheadQueue = new BlockingCollection <T>(new ConcurrentQueue <T>());
     hashCode       = socketIdentity.GetHashCode();
 }
Ejemplo n.º 2
0
        public void ReceiverNode_IsConsistentlyTransferredViaMultipartMessage()
        {
            var message      = Message.CreateFlowStartMessage(new SimpleMessage()).As <Message>();
            var receiverNode = ReceiverIdentifier.Create();

            message.SetReceiverNode(receiverNode);

            var multipart = new MultipartMessage(message);

            message = Message.FromMultipartMessage(multipart);

            CollectionAssert.AreEqual(receiverNode.Identity, message.ReceiverNodeIdentity);
        }
Ejemplo n.º 3
0
 public MessageHub(IInternalRegistrationService internalRegistrationService,
                   ILocalSocketFactory localSocketFactory,
                   IMessageRouter messageRouter,
                   ISecurityProvider securityProvider,
                   ICallbackHandlerStack callbackHandlers)
 {
     ReceiverIdentifier = ReceiverIdentifier.Create(ReceiverKind.MessageHub);
     this.internalRegistrationService = internalRegistrationService;
     this.messageRouter    = messageRouter;
     this.securityProvider = securityProvider;
     this.callbackHandlers = callbackHandlers;
     socket = localSocketFactory.Create(DispatchMessage);
 }