/// <summary> /// Send RPC call to a given node. /// </summary> /// <param name="node">Destination node for this RPC call</param> /// <param name="mod">Module name to call</param> /// <param name="fun">Function name to call</param> /// <param name="args">Function arguments</param> /// <param name="ioServer">Either a PID or an Atom containing registered I/O server's name.</param> public void AsyncRPC(ErlAtom node, ErlAtom mod, ErlAtom fun, ErlList args, IErlObject ioServer) { if (node.Equals(m_Node.NodeName)) { throw new ErlException(StringConsts.ERL_CONN_LOCAL_RPC_ERROR); } else { IErlObject msg = Internal.ErlRpcServer.EncodeRPC(m_Self, mod, fun, args, ioServer); var conn = m_Node.Connection(node); if (conn == null) { throw new ErlException(StringConsts.ERL_CONN_CANT_CONNECT_TO_NODE_ERROR.Args(node)); } conn.Send(m_Self, ConstAtoms.Rex, msg); } }
public void ApplicationStartBeforeInit(IApplication application) { s_Node.Start(); foreach (var dn in m_RemoteNodes) { s_Node.Connection(dn.Value, dn); } // Ensure proper cleanup of local node's global state application.RegisterAppFinishNotifiable(s_Node); }
public void ApplicationStartBeforeInit(IApplication application) { s_Node.Start(); foreach (var dn in m_RemoteNodes) { s_Node.Connection(dn.Value, dn); } //remember configs for remote nodes s_Node.RemoteNodeConfigs = (IConfigSectionNode[])m_RemoteNodes.Clone(); // Ensure proper cleanup of local node's global state application.RegisterAppFinishNotifiable(s_Node); }
public void ApplicationStartBeforeInit(IApplication application) { s_Node.Start(); // Establish connections to all listed remote nodes m_AllNodes.Children .Where(n => n.Name.EqualsSenseCase("node") && !n.AttrByName(ErlConsts.CONFIG_IS_LOCAL_ATTR).ValueAsBool() && n.AttrByName(ErlConsts.ERLANG_CONNECT_ON_STARUP).ValueAsBool(true)) .ForEach(n => s_Node.Connection(n.Value, n)); //remember configs for remote nodes s_Node.AllNodeConfigs = m_AllNodes; // Ensure proper cleanup of local node's global state application.RegisterAppFinishNotifiable(s_Node); }
public void ApplicationStartBeforeInit(IApplication application) { s_Node.Start(); foreach (var dn in m_RemoteNodes) { if (dn.AttrByName(ErlConsts.ERLANG_CONNECT_ON_STARUP).ValueAsBool(true)) { s_Node.Connection(dn.Value, dn); } } //remember configs for remote nodes s_Node.RemoteNodeConfigs = (IConfigSectionNode[])m_RemoteNodes.Clone(); // Ensure proper cleanup of local node's global state application.RegisterAppFinishNotifiable(s_Node); }