K2Informatics.Erlnet.OtpMbox.breakLinks C# (CSharp) Method

breakLinks() public method

public breakLinks ( OtpErlangObject reason ) : void
reason OtpErlangObject
return void
        public void breakLinks(OtpErlangObject reason)
        {
            Link[] l = links.clearLinks();

            if (l != null)
            {
                int len = l.Length;

                for (int i = 0; i < len; i++)
                {
                    exit(1, l[i].Remote, reason);
                }
            }
        }

Usage Example

Example #1
0
 /**
  * Close the specified mailbox with the given reason.
  *
  * @param mbox
  *            the mailbox to close.
  * @param reason
  *            an Erlang term describing the reason for the termination.
  *
  *            <p>
  *            After this operation, the mailbox will no longer be able to
  *            receive messages. Any delivered but as yet unretrieved
  *            messages can still be retrieved however.
  *            </p>
  *
  *            <p>
  *            If there are links from the mailbox to other
  *            {@link OtpErlangPid pids}, they will be broken when this
  *            method is called and exit signals with the given reason will
  *            be sent.
  *            </p>
  *
  */
 public void closeMbox(OtpMbox mbox, OtpErlangObject reason)
 {
     if (mbox != null)
     {
         mboxes.remove(mbox);
         mbox.Name = null;
         mbox.breakLinks(reason);
     }
 }