Example #1
0
 protected void SendTerm(Own destination, int linger)
 {
     Command cmd = new Command(destination, CommandType.Term, linger);
     SendCommand (cmd);
 }
Example #2
0
 protected void SendReaped()
 {
     Command cmd = new Command(m_ctx.GetReaper(), CommandType.Reaped);
     SendCommand (cmd);
 }
Example #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);
 }
Example #4
0
        protected void SendPlug(Own destination, bool incSeqnum)
        {
            if (incSeqnum)
                destination.IncSeqnum ();

            Command cmd = new Command(destination, CommandType.Plug);
            SendCommand (cmd);
        }
Example #5
0
 protected void SendReap(SocketBase socket)
 {
     Command cmd = new Command(m_ctx.GetReaper (), CommandType.Reap, socket);
     SendCommand (cmd);
 }
Example #6
0
 private void SendCommand(Command cmd)
 {
     m_ctx.SendCommand (cmd.Destination.Tid , cmd);
 }
Example #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);
            }
        }
Example #8
0
 protected void SendDone()
 {
     Command cmd = new Command(null, CommandType.Done);
     m_ctx.SendCommand(Ctx.TermTid, cmd);
 }
Example #9
0
 protected void SendHiccup(Pipe destination, Object pipe)
 {
     Command cmd = new Command(destination, CommandType.Hiccup, pipe);
     SendCommand (cmd);
 }
Example #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);
        }
Example #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);
        }
Example #12
0
        protected void SendActivateWrite(Pipe destination,
		                                    long msgsRead)
        {
            Command cmd = new Command(destination, CommandType.ActivateWrite, msgsRead);
            SendCommand (cmd);
        }
Example #13
0
 protected void SendActivateRead(Pipe destination)
 {
     Command cmd = new Command(destination, CommandType.ActivateRead);
     SendCommand (cmd);
 }
Example #14
0
        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();
            }
        }
Example #15
0
 protected void SendTermAck(Own destination)
 {
     Command cmd = new Command(destination, CommandType.TermAck);
     SendCommand (cmd);
 }
Example #16
0
 protected void SendOwn(Own destination, Own obj)
 {
     destination.IncSeqnum ();
     Command cmd = new Command(destination, CommandType.Own, obj);
     SendCommand (cmd);
 }
Example #17
0
        protected void SendTermReq(Own destination,
		                              Own object_)
        {
            Command cmd = new Command(destination, CommandType.TermReq, object_);
            SendCommand (cmd);
        }
Example #18
0
 protected void SendPipeTermAck(Pipe destination)
 {
     Command cmd = new Command(destination, CommandType.PipeTermAck);
     SendCommand (cmd);
 }
Example #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();
            }
        }
Example #20
0
 //  Send command to the destination thread.
 public void SendCommand(int tid, Command command)
 {
     m_slots[tid].Send(command);
 }