Example #1
0
        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);
            }
        }
Example #2
0
        private void TryAppendConfigToRemoteNode(ErlRemoteNode peer)
        {
            if (AllNodeConfigs == null)
            {
                return;
            }

            var cfg = RemoteNodeConfig(peer.NodeName);

            if (cfg.Exists)
            {
                peer.Configure(cfg);
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
            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;
                }
            }
Example #5
0
        private void TryAppendConfigToRemoteNode(ErlRemoteNode peer)
        {
            if (AllNodeConfigs == null) return;

              var cfg = RemoteNodeConfig(peer.NodeName);

              if (cfg.Exists)
            peer.Configure(cfg);
        }
Example #6
0
        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);
        }