예제 #1
0
 protected void SendTerm(Own destination, int linger)
 {
     Command cmd = new Command(destination, CommandType.Term, linger);
     SendCommand (cmd);
 }
예제 #2
0
 protected void SendReaped()
 {
     Command cmd = new Command(m_ctx.GetReaper(), CommandType.Reaped);
     SendCommand (cmd);
 }
예제 #3
0
 protected void SendStop()
 {
     //  'stop' command goes always from administrative thread to
     //  the current object.
     Command cmd = new Command(this, CommandType.Stop);
     m_ctx.SendCommand (m_tid, cmd);
 }
예제 #4
0
        protected void SendPlug(Own destination, bool incSeqnum)
        {
            if (incSeqnum)
                destination.IncSeqnum ();

            Command cmd = new Command(destination, CommandType.Plug);
            SendCommand (cmd);
        }
예제 #5
0
 protected void SendReap(SocketBase socket)
 {
     Command cmd = new Command(m_ctx.GetReaper (), CommandType.Reap, socket);
     SendCommand (cmd);
 }
예제 #6
0
 private void SendCommand(Command cmd)
 {
     m_ctx.SendCommand (cmd.Destination.Tid , cmd);
 }
예제 #7
0
        public void Send(Command command)
        {
            bool ok;
            lock (m_sync)
            {
                m_commandPipe.Write(ref command, false);
                ok = m_commandPipe.Flush();
            }

            if (!ok)
            {
                m_proactor.SignalMailbox(this);
            }
        }
예제 #8
0
 protected void SendDone()
 {
     Command cmd = new Command(null, CommandType.Done);
     m_ctx.SendCommand(Ctx.TermTid, cmd);
 }
예제 #9
0
 protected void SendHiccup(Pipe destination, Object pipe)
 {
     Command cmd = new Command(destination, CommandType.Hiccup, pipe);
     SendCommand (cmd);
 }
예제 #10
0
        protected void SendAttach(SessionBase destination,
		                            IEngine engine, bool incSeqnum)
        {
            if (incSeqnum)
                destination.IncSeqnum ();

            Command cmd = new Command(destination, CommandType.Attach, engine);
            SendCommand (cmd);
        }
예제 #11
0
        protected void SendBind(Own destination, Pipe pipe,
		                          bool incSeqnum)
        {
            if (incSeqnum)
                destination.IncSeqnum ();

            Command cmd = new Command(destination, CommandType.Bind, pipe);
            SendCommand (cmd);
        }
예제 #12
0
        protected void SendActivateWrite(Pipe destination,
		                                    long msgsRead)
        {
            Command cmd = new Command(destination, CommandType.ActivateWrite, msgsRead);
            SendCommand (cmd);
        }
예제 #13
0
 protected void SendActivateRead(Pipe destination)
 {
     Command cmd = new Command(destination, CommandType.ActivateRead);
     SendCommand (cmd);
 }
예제 #14
0
파일: Mailbox.cs 프로젝트: EugenDueck/netmq
        public void Send(Command cmd)
        {
            bool ok = false;
            lock (m_sync)
            {
                m_cpipe.Write(cmd, false);
                ok = m_cpipe.Flush();
            }

            //if (LOG.isDebugEnabled())
            //    LOG.debug( "{} -> {} / {} {}", new Object[] { Thread.currentThread().getName(), cmd_, cmd_.arg , !ok});

            if (!ok)
            {
                m_signaler.Send();
            }
        }
예제 #15
0
 protected void SendTermAck(Own destination)
 {
     Command cmd = new Command(destination, CommandType.TermAck);
     SendCommand (cmd);
 }
예제 #16
0
 protected void SendOwn(Own destination, Own obj)
 {
     destination.IncSeqnum ();
     Command cmd = new Command(destination, CommandType.Own, obj);
     SendCommand (cmd);
 }
예제 #17
0
        protected void SendTermReq(Own destination,
		                              Own object_)
        {
            Command cmd = new Command(destination, CommandType.TermReq, object_);
            SendCommand (cmd);
        }
예제 #18
0
 protected void SendPipeTermAck(Pipe destination)
 {
     Command cmd = new Command(destination, CommandType.PipeTermAck);
     SendCommand (cmd);
 }
예제 #19
0
        public void ProcessCommand(Command cmd)
        {
            switch (cmd.CommandType) {

                case CommandType.ActivateRead:
                    ProcessActivateRead ();
                    break;

                case CommandType.ActivateWrite:
                    ProcessActivateWrite ((long)cmd.Arg);
                    break;

                case CommandType.Stop:
                    ProcessStop ();
                    break;

                case CommandType.Plug:
                    ProcessPlug ();
                    ProcessSeqnum ();
                    break;

                case CommandType.Own:
                    ProcessOwn ((Own)cmd.Arg);
                    ProcessSeqnum ();
                    break;

                case CommandType.Attach:
                    ProcessAttach ((IEngine)cmd.Arg);
                    ProcessSeqnum ();
                    break;

                case CommandType.Bind:
                    ProcessBind ((Pipe)cmd.Arg);
                    ProcessSeqnum ();
                    break;

                case CommandType.Hiccup:
                    ProcessHiccup (cmd.Arg);
                    break;

                case CommandType.PipeTerm:
                    ProcessPipeTerm ();
                    break;

                case CommandType.PipeTermAck:
                    ProcessPipeTermAck ();
                    break;

                case CommandType.TermReq:
                    ProcessTermReq ((Own)cmd.Arg);
                    break;

                case CommandType.Term:
                    ProcessTerm ((int)cmd.Arg);
                    break;

                case CommandType.TermAck:
                    ProcessTermAck ();
                    break;

                case CommandType.Reap:
                    ProcessReap ((SocketBase)cmd.Arg);
                    break;

                case CommandType.Reaped:
                    ProcessReaped ();
                    break;

                default:
                    throw new ArgumentException();
            }
        }
예제 #20
0
파일: Ctx.cs 프로젝트: oskarwkarlsson/netmq
 //  Send command to the destination thread.
 public void SendCommand(int tid, Command command)
 {
     m_slots[tid].Send(command);
 }