public OtpEpmdConnection(OtpEpmd epmd, TcpClient sock) : base("OtpEpmd.OtpEpmdConnection", true) { this.epmd = epmd; this.portmap = epmd.Portmap; this.sock = sock; }
/** * 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); }
protected override void OnStart(string[] args) { if (!m_started) { m_epmd = new OtpEpmd(); m_epmd.start(); m_started = true; } }
private void unPublishPort() { // unregister with epmd OtpEpmd.unPublishPort(node); // close the local descriptor (if we have one) closeSock(node.getEpmd()); node.setEpmd(null); }
private bool publishPort() { if (node.getEpmd() != null) { return(false); // already published } OtpEpmd.publishPort(node); return(true); }
/** * 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); }
/** * 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; }
/** * 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; }
protected override void OnStart(string[] args) { epmd = new OtpEpmd(); epmd.ServeAsync(); }
// 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)); }