Inheritance: ThreadBase
示例#1
0
 public OtpEpmdConnection(OtpEpmd epmd, TcpClient sock)
     : base("OtpEpmd.OtpEpmdConnection", true)
 {
     this.epmd    = epmd;
     this.portmap = epmd.Portmap;
     this.sock    = sock;
 }
示例#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.
  *
  * This method will fail if an Epmd process is not running on the localhost.
  * See the Erlang documentation for information about starting Epmd.
  *
  * 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()}.
  */
 public bool PublishPort()
 {
     if (Epmd is null)
     {
         Epmd = OtpEpmd.PublishPort(this);
     }
     return(Epmd != null);
 }
示例#3
0
 protected override void OnStart(string[] args)
 {
     if (!m_started)
     {
         m_epmd = new OtpEpmd();
         m_epmd.start();
         m_started = true;
     }
 }
示例#4
0
            private void unPublishPort()
            {
                // unregister with epmd
                OtpEpmd.unPublishPort(node);

                // close the local descriptor (if we have one)
                closeSock(node.getEpmd());
                node.setEpmd(null);
            }
示例#5
0
 private bool publishPort()
 {
     if (node.getEpmd() != null)
     {
         return(false); // already published
     }
     OtpEpmd.publishPort(node);
     return(true);
 }
示例#6
0
 protected override void OnStart(string[] args)
 {
     if (!m_started)
     {
         m_epmd = new OtpEpmd();
         m_epmd.start();
         m_started = true;
     }
 }
示例#7
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 java.io.IOException
         *                    if the port mapper could not be contacted.
         */
        public bool publishPort()
        {
            if (getEpmd() != null)
            {
                return(false); // already published
            }

            OtpEpmd.publishPort(this);
            return(getEpmd() != null);
        }
示例#8
0
        /**
         * Unregister the server node's name and port number from the Erlang port
         * mapper, thus preventing any new connections from remote nodes.
         */
        public void UnPublishPort()
        {
            if (Epmd == null)
            {
                return;
            }

            // Unregister
            OtpEpmd.UnPublishPort(this);

            // Close and ignore errors
            OtpTransport.Close(Epmd);
            Epmd = null;
        }
示例#9
0
        /**
         * Unregister the server node's name and port number from the Erlang port
         * mapper, thus preventing any new connections from remote nodes.
         */
        public void unPublishPort()
        {
            // unregister with epmd
            OtpEpmd.unPublishPort(this);

            // close the local descriptor (if we have one)
            try
            {
                if (getEpmd() != null)
                {
                    closeEpmd();
                }
            }
            catch (IOException) /* ignore close errors */
            {
            }
            base.epmd = null;
        }
示例#10
0
 protected override void OnStart(string[] args)
 {
     epmd = new OtpEpmd();
     epmd.ServeAsync();
 }
 public OtpEpmdConnection(OtpEpmd epmd, TcpClient sock)
     : base("OtpEpmd.OtpEpmdConnection", true)
 {
     this.epmd = epmd;
     this.portmap = epmd.Portmap;
     this.sock = sock;
 }
示例#12
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 int port()
        {
            return(OtpEpmd.lookupPort(this));
        }