/// <summary> /// Creates a new INode instance /// </summary> /// <returns>A new INode instance</returns> public static INode BuildNode() { var n = new Node {LastPulse = DateTime.UtcNow.Ticks}; return n; }
protected MultiNodeSpec( RoleName myself, ActorSystem system, ImmutableList<RoleName> roles, Func<RoleName, ImmutableList<string>> deployments) : base(new XunitAssertions(), system) { _myself = myself; _log = Logging.GetLogger(Sys, this); _roles = roles; _deployments = deployments; var node = new Node() { Host = Dns.GetHostEntry(ServerName).AddressList.First(a => a.AddressFamily == AddressFamily.InterNetwork), Port = ServerPort }; _controllerAddr = node; AttachConductor(new TestConductor(system)); _replacements = _roles.ToImmutableDictionary(r => r, r => new Replacement("@" + r.Name + "@", r, this)); InjectDeployments(system, myself); _myAddress = system.AsInstanceOf<ExtendedActorSystem>().Provider.DefaultAddress; Log.Info("Role [{0}] started with address [{1}]", myself.Name, _myAddress); }
/// <summary> /// Creates an INode instance from an IP endpoint /// </summary> /// <param name="endPoint">A System.NET.IPEndpoint argument, usually from an incoming socket connection</param> /// <returns>An active INode instance</returns> public static INode FromEndpoint(IPEndPoint endPoint) { var n = new Node {Host = endPoint.Address, Port = endPoint.Port}; return n; }