コード例 #1
0
        /**
         * Close the node. Unpublish the node from Epmd (preventing new connections)
         * and close all existing connections.
         */
        public void close()
        {
            lock (this)
            {
                acceptor.quit();

                mboxes.clear();

                lock (connections)
                {
                    OtpCookedConnection[] conns = new OtpCookedConnection[connections.Count];
                    int i = 0;
                    foreach (OtpCookedConnection conn in connections.Values)
                    {
                        conns[i++] = conn;
                    }
                    connections.Clear();
                    foreach (OtpCookedConnection conn in conns)
                    {
                        conn.close();
                    }
                    initDone = false;
                }
            }
        }