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

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