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(); }
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); }
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); }