Inheritance: ThreadBase
コード例 #1
0
ファイル: OtpEpmd.Server.cs プロジェクト: tarachom/Erlang.NET
 public OtpEpmdConnection(OtpEpmd epmd, TcpClient sock)
     : base("OtpEpmd.OtpEpmdConnection", true)
 {
     this.epmd    = epmd;
     this.portmap = epmd.Portmap;
     this.sock    = sock;
 }
コード例 #2
0
ファイル: OtpLocalNode.cs プロジェクト: reganheath/Erlang.NET
 /**
  * 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
ファイル: epmd.cs プロジェクト: tarachom/Erlang.NET
 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
ファイル: epmd.cs プロジェクト: takayuki/opensim-pcproject
 protected override void OnStart(string[] args)
 {
     if (!m_started)
     {
         m_epmd = new OtpEpmd();
         m_epmd.start();
         m_started = true;
     }
 }
コード例 #7
0
ファイル: OtpSelf.cs プロジェクト: tarachom/Erlang.NET
        /**
         * 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
ファイル: OtpLocalNode.cs プロジェクト: reganheath/Erlang.NET
        /**
         * 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
ファイル: OtpSelf.cs プロジェクト: tarachom/Erlang.NET
        /**
         * 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();
 }
コード例 #11
0
 public OtpEpmdConnection(OtpEpmd epmd, TcpClient sock)
     : base("OtpEpmd.OtpEpmdConnection", true)
 {
     this.epmd = epmd;
     this.portmap = epmd.Portmap;
     this.sock = sock;
 }
コード例 #12
0
ファイル: OtpPeer.cs プロジェクト: tarachom/Erlang.NET
        // 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));
        }