internal ErlConnection Connection(string toNode, IConfigSectionNode config, ErlAtom?cookie = null) { var peer = new ErlRemoteNode(this, toNode); // This will convert toNode to a valid ErlAtom lock (m_Connections) { ErlConnection c; if (m_Connections.TryGetValue(peer.NodeName, out c)) { return(c); } peer.Configure(config); // Fetch all proper TCP and other settings try { c = new ErlConnection(this, peer, true); } catch { return(null); } // TODO: maybe add return reason for connection failure? m_Connections.TryAdd(peer.NodeName, c); return(c); } }
private void TryAppendConfigToRemoteNode(ErlRemoteNode peer) { if (AllNodeConfigs == null) { return; } var cfg = RemoteNodeConfig(peer.NodeName); if (cfg.Exists) { peer.Configure(cfg); } }
private void TryAppendConfigToRemoteNode(ErlRemoteNode peer) { if (RemoteNodeConfigs == null) { return; } var conf = RemoteNodeConfigs.FirstOrDefault(c => c.Value.IsNotNullOrEmpty() && c.Value.EqualsSenseCase(peer.NodeName)); if (conf != null) { peer.Configure(conf); } }
internal ErlConnection Connection(string toNode, IConfigSectionNode config) { var peer = new ErlRemoteNode(this, toNode); // This will convert toNode to a valid ErlAtom lock (m_Connections) { ErlConnection c; if (m_Connections.TryGetValue(peer.NodeName, out c)) return c; peer.Configure(config); // Fetch all proper TCP and other settings try { c = new ErlConnection(this, peer, true); } catch { return null; } m_Connections.TryAdd(peer.NodeName, c); return c; } }
private void TryAppendConfigToRemoteNode(ErlRemoteNode peer) { if (AllNodeConfigs == null) return; var cfg = RemoteNodeConfig(peer.NodeName); if (cfg.Exists) peer.Configure(cfg); }
private void TryAppendConfigToRemoteNode(ErlRemoteNode peer) { if (RemoteNodeConfigs == null) return; var conf = RemoteNodeConfigs.FirstOrDefault( c => c.Value.IsNotNullOrEmpty() && c.Value.EqualsSenseCase(peer.NodeName)); if (conf != null) peer.Configure(conf); }