Ejemplo n.º 1
0
        internal static string ActorRefToString(IActorRef actor, CreateInvitationMessage cim)
        {
            //{[akka://UserOne/user/Echo#748748065]}
            //akka.tcp://UserOne@localhost:8081/user/Echo
            var systemName = actor.Path.Root.ToString().Replace("akka", "akka.tcp");
            var sb         = new StringBuilder();

            sb.Append(systemName);
            sb.Length--;

            sb.Append("@" + cim.PublicPortName + ":" + cim.Port);

            sb.Append("/user/" + actor.Path.Name);

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        internal static void CreateInvitation(CurrentCluster cluster, IActorRef actor, CreateInvitationMessage cim)
        {
            var i = new ClusterInvitation {
                InvitationAddress = ActorRefToString(actor, cim), InvitationKey = cluster.Key
            };
            var json = JsonConvert.SerializeObject(i);

            File.WriteAllText("invitation.config", json);
        }