예제 #1
0
파일: OtpNode.cs 프로젝트: trompa/jungerl
            private void  unPublishPort()
            {
                // unregister with epmd
                OtpEpmd.unPublishPort(a_node);

                // close the local descriptor (if we have one)
                closeSock(a_node.epmd);
                a_node.epmd = null;
            }
예제 #2
0
파일: OtpNode.cs 프로젝트: trompa/jungerl
 private bool publishPort()
 {
     if (a_node.getEpmd() != null)
     {
         return(false);
     }
     // already published
     OtpEpmd.publishPort(a_node);
     return(true);
 }
예제 #3
0
        /*
         * Make public the information needed by remote nodes that may wish
         * to connect to this one. This method establishes a connection to
         * the Erlang port mapper (Epmd) and registers the server node's
         * name and port so that remote nodes are able to connect.
         *
         * <p> This method will fail if an Epmd process is not running on
         * the localhost. See the Erlang documentation for information about
         * starting Epmd.
         *
         * <p> Note that once this method has been called, the node is
         * expected to be available to accept incoming connections. For that
         * reason you should make sure that you call {@link #accept()}
         * shortly after calling {@link #publishPort()}. When you no longer
         * intend to accept connections you should call {@link
         * #unPublishPort()}.
         *
         * @return true if the operation was successful, false if the node
         * was already registered.
         *
         * @exception C#.io.IOException if the port mapper could not be contacted.
         **/
        public virtual bool publishPort()
        {
            if (getEpmd() != null)
            {
                return(false);
            }
            // already published

            OtpEpmd.publishPort(this);
            return(getEpmd() != null);
        }
예제 #4
0
        /*
         * Unregister the server node's name and port number from the Erlang
         * port mapper, thus preventing any new connections from remote
         * nodes.
         **/
        public virtual void  unPublishPort()
        {
            // unregister with epmd
            OtpEpmd.unPublishPort(this);

            // close the local descriptor (if we have one)
            try
            {
                if (base.epmd != null)
                {
                    base.epmd.Close();
                }
            }
            catch (System.IO.IOException)
            {
                /*ignore close errors */
            }
            base.epmd = null;
        }
예제 #5
0
        // package

        /*
         * Get the port number used by the remote node.
         *
         * @return the port number used by the remote node, or 0 if the node
         * was not registered with the port mapper.
         *
         * @exception java.io.IOException if the port mapper could not be contacted.
         **/
        internal virtual int port()
        {
            return(OtpEpmd.lookupPort(this));
        }