Exemplo n.º 1
0
 protected void CloseHandlerWithReply(NodeReply replyMsg, NodeInfo replyTarget, RequestResponseHandler <Guid> responder = null)
 {
     SendReplyTo(replyTarget, replyMsg);
     if (responder != null)
     {
         Unsubscribe(responder);
     }
     CloseHandler();
 }
Exemplo n.º 2
0
 protected void SendReplyTo(NodeInfo target, NodeReply reply)
 {
     if (target.Equals(Node.Identity))
     {
         SendLocalMessage(reply);
     }
     else
     {
         var forwardingSocket = Node.ForwardingSockets[target.HostAndPort];
         Node.Marshaller.Send(reply, forwardingSocket);
     }
 }
Exemplo n.º 3
0
        public NetMQMessage Marshall(NodeReply msg)
        {
            var json   = _serializer.Serialize(msg);
            var result = new NetMQMessage(new[]
            {
                new NetMQFrame(NodeReply),
                new NetMQFrame(EmptyByteArray),
                new NetMQFrame(json),
            });

            return(result);
        }
Exemplo n.º 4
0
 protected void SendReplyTo(NodeInfo target, NodeReply reply)
 {
     if (target.Equals(Identity))
     {
         MessageBus.Publish(reply);
     }
     else
     {
         var forwardingSocket = ForwardingSockets[target.HostAndPort];
         Marshaller.Send(reply, forwardingSocket);
     }
 }
Exemplo n.º 5
0
        public void Send(NodeReply msg, IOutgoingSocket outgoingSocket)
        {
            var mqMsg = Marshall(msg);

            outgoingSocket.SendMultipartMessage(mqMsg);
        }
Exemplo n.º 6
0
 public void Unmarshall(NetMQMessage netMqMessage, out NodeReply msg)
 {
     msg = (NodeReply)_serializer.Deserialize(json: netMqMessage[2].ConvertToString());
 }