Esempio n. 1
0
        private void DoDisco(string msg)
        {
            Become(new Behavior <Dictionary <string, string> >(Found));
            BaseActor rem = new RemoteSenderActor(new ActorTag(fUri));

            rem += new DiscoCommand(this); // send message
        }
Esempio n. 2
0
        private void Disco(string hostAddress)
        {
            Become(new Behavior <Dictionary <string, string> >(t => true, Found));
            var rem = new RemoteSenderActor(new ActorTag(hostAddress));

            rem.SendMessage(new DiscoCommand(this));
        }
        private void Disco(string hostAddress, IActor actor)
        {
            Become(new Behavior <Dictionary <string, string> >(t => { return(true); },
                                                               Found));
            var rem = new RemoteSenderActor(new ActorTag(hostAddress));

            rem.SendMessage(new DiscoCommand(actor));
        }
Esempio n. 4
0
        public object GetObjectToSerialize(object obj, Type targetType)
        {
            // Reset the property value using the GetValue method.

            // force misc init
            if (obj is RemoteSenderActor remoteActor)
            {
                BaseActor.CompleteInitialize(remoteActor);
                RemoteSenderActor.CompleteInitialize(remoteActor);
                // typeof(RemoteSenderActor).GetField("fRemoteTag").SetValue(obj, getTag);
            }

            return(obj);
        }
Esempio n. 5
0
        public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
        {
            // Reset the property value using the GetValue method.

            // force misc init
            if (obj is RemoteSenderActor remoteActor)
            {
                if (info == null)
                {
                    throw new ActorException("Receiving null SerializationInfo");
                }
                BaseActor.CompleteInitialize(remoteActor);
                RemoteSenderActor.CompleteInitialize(remoteActor);
                ActorTag getTag = (ActorTag)info.GetValue("RemoteTag", typeof(ActorTag));
                typeof(RemoteSenderActor).GetField("fRemoteTag").SetValue(obj, getTag);
            }
            return(null); // ms bug here
        }
Esempio n. 6
0
 public static void CompleteInitialize(RemoteSenderActor anActor)
 {
     CheckArg.Actor(anActor);
     anActor.fSerializeService = ActorServer.GetInstance().SerializeService;
     anActor.Become(new Behavior <object>(anActor.DoRouting));
 }
Esempio n. 7
0
        private void DoConnect(ActorTag tag)
        {
            IActor remoteSend = new RemoteSenderActor(tag);

            fSender.SendMessage(fServiceName, tag, remoteSend);
        }