getSenderPid() public method

public getSenderPid ( ) : Pid
return Otp.Erlang.Pid
Beispiel #1
0
        /*
         * called by OtpNode to deliver message to this mailbox.
         *
         * About exit and exit2: both cause exception to be raised upon
         * receive(). However exit (not 2) causes any link to be removed as
         * well, while exit2 leaves any links intact.
         */
        internal virtual void  deliver(OtpMsg m)
        {
            switch (m.type())
            {
            case OtpMsg.Tag.linkTag:
                links.addLink(_self, m.getSenderPid());
                break;

            case OtpMsg.Tag.unlinkTag:
                links.removeLink(_self, m.getSenderPid());
                break;

            case OtpMsg.Tag.exitTag:
                links.removeLink(_self, m.getSenderPid());
                queue.put(m);
                break;

            case OtpMsg.Tag.monitorPTag:
                monitors[m.getSenderPid()] = m.getMsg();
                break;

            case OtpMsg.Tag.demonitorPTag:
                monitors.Remove(m.getSenderPid());
                break;

            case OtpMsg.Tag.monitorPexitTag:
                queue.put(m);
                break;

            case OtpMsg.Tag.exit2Tag:
            default:
                queue.put(m);
                break;
            }
        }
        /*
         * 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.Tag.linkTag:
                if (delivered)
                {
                    links.addLink(msg.getRecipientPid(), msg.getSenderPid());
                }
                else
                {
                    try
                    {
                        // no such pid - send exit to sender
                        base.sendExit(msg.getRecipientPid(), msg.getSenderPid(), "noproc");
                    }
                    catch (System.IO.IOException)
                    {
                    }
                }
                break;

            case OtpMsg.Tag.monitorPTag:
                if (delivered)
                {
                    monitors[msg.getSenderPid()] = msg.getMsg();
                }
                else
                {
                    try
                    {
                        base.sendExit(msg.getRecipientPid(), msg.getSenderPid(), "noproc");
                    }
                    catch (System.IO.IOException)
                    {
                    }
                }
                break;

            case OtpMsg.Tag.demonitorPTag:
            case OtpMsg.Tag.monitorPexitTag:
                monitors.Remove(msg.getSenderPid());
                break;

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

            case OtpMsg.Tag.exit2Tag:
                break;
            }
            return;
        }
Beispiel #3
0
        /*
        * called by OtpNode to deliver message to this mailbox.
        *
        * About exit and exit2: both cause exception to be raised upon
        * receive(). However exit (not 2) causes any link to be removed as
        * well, while exit2 leaves any links intact.
        */
        internal virtual void deliver(OtpMsg m)
        {
            switch (m.type())
            {
                case OtpMsg.linkTag:
                    links.addLink(_self, m.getSenderPid());
                    break;

                case OtpMsg.unlinkTag:
                    links.removeLink(_self, m.getSenderPid());
                    break;

                case OtpMsg.exitTag:
                    links.removeLink(_self, m.getSenderPid());
                    queue.put(m);
                    break;

                case OtpMsg.exit2Tag: default:
                    queue.put(m);
                    break;
            }
        }
		/*
		* 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.Tag.linkTag:
					if (delivered)
					{
						links.addLink(msg.getRecipientPid(), msg.getSenderPid());
					}
					else
						try
						{
							// no such pid - send exit to sender
							base.sendExit(msg.getRecipientPid(), msg.getSenderPid(), "noproc");
						}
						catch (System.IO.IOException)
						{
						}
					break;

                case OtpMsg.Tag.monitorPTag:
                    if (delivered)
                        monitors[msg.getSenderPid()] = msg.getMsg();
                    else
                        try
                        {
                            base.sendExit(msg.getRecipientPid(), msg.getSenderPid(), "noproc");
                        }
                        catch (System.IO.IOException)
                        {
                        }
                    break;

                case OtpMsg.Tag.demonitorPTag:
                case OtpMsg.Tag.monitorPexitTag:
                    monitors.Remove(msg.getSenderPid());
                    break;

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

                case OtpMsg.Tag.exit2Tag:
					break;
			}
			return ;
		}
Beispiel #5
0
		/*
		* called by OtpNode to deliver message to this mailbox.
		*
		* About exit and exit2: both cause exception to be raised upon
		* receive(). However exit (not 2) causes any link to be removed as
		* well, while exit2 leaves any links intact.
		*/
		internal virtual void  deliver(OtpMsg m)
		{
			switch (m.type())
			{
                case OtpMsg.Tag.linkTag: 
					links.addLink(_self, m.getSenderPid());
					break;

                case OtpMsg.Tag.unlinkTag:
					links.removeLink(_self, m.getSenderPid());
					break;

                case OtpMsg.Tag.exitTag:
					links.removeLink(_self, m.getSenderPid());
					queue.put(m);
					break;

                case OtpMsg.Tag.monitorPTag:
                    monitors[m.getSenderPid()] = m.getMsg();
                    break;

                case OtpMsg.Tag.demonitorPTag:
                    monitors.Remove(m.getSenderPid());
                    break;

                case OtpMsg.Tag.monitorPexitTag:
                    queue.put(m);
                    break;

                case OtpMsg.Tag.exit2Tag:
                default:
					queue.put(m);
					break;
			}
		}