Erlang.NET.OtpNode.deliver C# (CSharp) 메소드

deliver() 공개 메소드

public deliver ( Erlang.NET.OtpMsg m ) : bool
m Erlang.NET.OtpMsg
리턴 bool
        public bool deliver(OtpMsg m)
        {
            OtpMbox mbox = null;

            try
            {
                int t = m.type();

                if (t == OtpMsg.regSendTag)
                {
                    String name = m.getRecipientName();
                    /* special case for netKernel requests */
                    if (name.Equals("net_kernel"))
                    {
                        return netKernel(m);
                    }
                    else
                    {
                        mbox = mboxes.get(name);
                    }
                }
                else
                {
                    mbox = mboxes.get(m.getRecipientPid());
                }

                if (mbox == null)
                {
                    return false;
                }
                mbox.deliver(m);
            }
            catch (Exception)
            {
                return false;
            }

            return true;
        }

Usage Example

예제 #1
0
        /*
         * pass the message to the node for final delivery. Note that the connection
         * itself needs to know about links (in case of connection failure), so we
         * snoop for link/unlink too here.
         */
        public override void deliver(OtpMsg msg)
        {
            bool delivered = self.deliver(msg);

            switch (msg.type())
            {
            case OtpMsg.linkTag:
                if (delivered)
                {
                    links.addLink(msg.getRecipientPid(), msg.getSenderPid());
                }
                else
                {
                    try
                    {
                        // no such pid - send exit to sender
                        base.sendExit(msg.getRecipientPid(), msg.getSenderPid(), new OtpErlangAtom("noproc"));
                    }
                    catch (IOException)
                    {
                    }
                }
                break;

            case OtpMsg.unlinkTag:
            case OtpMsg.exitTag:
                links.removeLink(msg.getRecipientPid(), msg.getSenderPid());
                break;

            case OtpMsg.exit2Tag:
                break;
            }

            return;
        }
All Usage Examples Of Erlang.NET.OtpNode::deliver