publishPort() public static method

public static publishPort ( OtpLocalNode node ) : bool
node OtpLocalNode
return bool
Exemplo n.º 1
0
 private bool publishPort()
 {
     if (a_node.getEpmd() != null)
     {
         return(false);
     }
     // already published
     OtpEpmd.publishPort(a_node);
     return(true);
 }
Exemplo n.º 2
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);
        }