Source/NFX.Erlang/Connect/ErlMbox.cs
/// <summary>
/// Called to deliver message to this mailbox
/// </summary>
Called to deliver message to this mailbox
Called to deliver message to this mailbox
internal void Deliver(ErlMsg m)
    {
      Debug.Assert((m.Recipient is ErlPid  && m.RecipientPid == m_Self)
                || (m.Recipient is ErlAtom && m.RecipientName == m_RegName));
      switch (m.Type)
      {
        case ErlMsg.Tag.Link:
          m_Links.Add(m.SenderPid);
          break;
        case ErlMsg.Tag.Unlink:
          m_Links.Remove(m.SenderPid);
          break;
        case ErlMsg.Tag.Exit:
        case ErlMsg.Tag.Exit2:
          m_Monitors.Remove(m.Ref);
          if (m_Links.Remove(m.SenderPid))
            Enqueue(m);
          break;
        case ErlMsg.Tag.MonitorP:
          m_Monitors.Add(m.Ref, m.SenderPid);
          break;
        case ErlMsg.Tag.DemonitorP:
          m_Monitors.Remove(m.Ref);
          break;
        case ErlMsg.Tag.MonitorPexit:
          m_Links.Remove(m.SenderPid);
          if (m_Monitors.Remove(m.Ref))
            Enqueue(new ErlDown(m.Ref, m.SenderPid, m.Reason));
          break;
        case ErlMsg.Tag.Undefined:
          break;
        default:
          Enqueue(m);
          break;
      }
    }
internal void Deliver ( ErlMsg m ) { Debug . Assert ( ( m . Recipient is ErlPid && m . RecipientPid == m_Self ) || ( m . Recipient is ErlAtom && m . RecipientName == m_RegName ) ) ; switch ( m . Type ) { case ErlMsg . Tag . Link : m_Links . Add ( m . SenderPid ) ; break ; case ErlMsg . Tag . Unlink : m_Links . Remove ( m . SenderPid ) ; break ; case ErlMsg . Tag . Exit : case ErlMsg . Tag . Exit2 : m_Monitors . Remove ( m . Ref ) ; if ( m_Links . Remove ( m . SenderPid ) ) Enqueue ( m ) ; break ; case ErlMsg . Tag . MonitorP : m_Monitors . Add ( m . Ref , m . SenderPid ) ; break ; case ErlMsg . Tag . DemonitorP : m_Monitors . Remove ( m . Ref ) ; break ; case ErlMsg . Tag . MonitorPexit : m_Links . Remove ( m . SenderPid ) ; if ( m_Monitors . Remove ( m . Ref ) ) Enqueue ( new ErlDown ( m . Ref , m . SenderPid , m . Reason ) ) ; break ; case ErlMsg . Tag . Undefined : break ; default : Enqueue ( m ) ; break ; } }
Called to deliver message to this mailbox
Called to deliver message to this mailbox
m
ErlMsg