Exemple #1
0
        public static void SendMessage(PID pid, object msg, int serializerId)
        {
            var(message, sender, _) = Proto.MessageEnvelope.Unwrap(msg);

            var env = new RemoteDeliver(message, pid, sender, serializerId);

            EndpointManagerPid.Tell(env);
        }
        public static void SendRemoteMessage(PID pid, object msg)
        {
            var(message, sender, _) = Proto.MessageEnvelope.Unwrap(msg);

            if (message is IMessage protoMessage)
            {
                var env = new RemoteDeliver(protoMessage, pid, sender);
                Remote.EndpointManagerPid.Tell(env);
            }
            else
            {
                throw new NotSupportedException("Non protobuf message");
            }
        }
Exemple #3
0
        public static void SendRemoteMessage(PID pid, object msg, PID sender)
        {
            if (msg is IMessage)
            {
                var imsg = (IMessage)msg;
                var env  = new RemoteDeliver(imsg, pid, sender);

                /*
                 *
                 * {
                 *  Target = pid,
                 *  Sender = sender,
                 *  MessageData = Serialization.Serialize(imsg),
                 *  TypeName = imsg.Descriptor.File.Package + "." + imsg.Descriptor.Name
                 * };
                 */
                RemotingSystem.EndpointManagerPid.Tell(env);
            }
            else
            {
                throw new NotSupportedException("Non protobuf message");
            }
        }
        public static void RemoteDeliver(RemoteDeliver msg)
        {
            var endpoint = EnsureConnected(msg.Target.Address);

            endpoint.Writer.Tell(msg);
        }
        public static void RemoteDeliver(RemoteDeliver msg)
        {
            var endpoint = EnsureConnected(msg.Target.Address);

            RootContext.Empty.Send(endpoint.Writer, msg);
        }