Erlang.NET.OtpEpmd.unPublishPort C# (CSharp) Method

unPublishPort() public static method

public static unPublishPort ( OtpLocalNode node ) : void
node OtpLocalNode
return void
        public static void unPublishPort(OtpLocalNode node)
        {
            try
            {
                using (TcpClient s = new TcpClient(Dns.GetHostName(), EpmdPort.get()))
                {
                    OtpOutputStream obuf = new OtpOutputStream();
                    obuf.write2BE(node.Alive.Length + 1);
                    obuf.write1(stopReq);
                    obuf.writeN(Encoding.GetEncoding("iso-8859-1").GetBytes(node.Alive));
                    obuf.WriteTo(s.GetStream());
                    // don't even wait for a response (is there one?)
                    if (traceLevel >= traceThreshold)
                    {
                        log.Debug("-> UNPUBLISH " + node + " port=" + node.Port);
                        log.Debug("<- OK (assumed)");
                    }
                }
            }
            catch (Exception) /* ignore all failures */
            {
            }
        }

Usage Example

コード例 #1
0
            private void unPublishPort()
            {
                // unregister with epmd
                OtpEpmd.unPublishPort(node);

                // close the local descriptor (if we have one)
                closeSock(node.getEpmd());
                node.setEpmd(null);
            }
All Usage Examples Of Erlang.NET.OtpEpmd::unPublishPort