protected void SendTerm(Own destination, int linger) { Command cmd = new Command(destination, CommandType.Term, linger); SendCommand (cmd); }
protected void SendReaped() { Command cmd = new Command(m_ctx.GetReaper(), CommandType.Reaped); SendCommand (cmd); }
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); }
protected void SendPlug(Own destination, bool incSeqnum) { if (incSeqnum) destination.IncSeqnum (); Command cmd = new Command(destination, CommandType.Plug); SendCommand (cmd); }
protected void SendReap(SocketBase socket) { Command cmd = new Command(m_ctx.GetReaper (), CommandType.Reap, socket); SendCommand (cmd); }
private void SendCommand(Command cmd) { m_ctx.SendCommand (cmd.Destination.Tid , cmd); }
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); } }
protected void SendDone() { Command cmd = new Command(null, CommandType.Done); m_ctx.SendCommand(Ctx.TermTid, cmd); }
protected void SendHiccup(Pipe destination, Object pipe) { Command cmd = new Command(destination, CommandType.Hiccup, pipe); SendCommand (cmd); }
protected void SendAttach(SessionBase destination, IEngine engine, bool incSeqnum) { if (incSeqnum) destination.IncSeqnum (); Command cmd = new Command(destination, CommandType.Attach, engine); SendCommand (cmd); }
protected void SendBind(Own destination, Pipe pipe, bool incSeqnum) { if (incSeqnum) destination.IncSeqnum (); Command cmd = new Command(destination, CommandType.Bind, pipe); SendCommand (cmd); }
protected void SendActivateWrite(Pipe destination, long msgsRead) { Command cmd = new Command(destination, CommandType.ActivateWrite, msgsRead); SendCommand (cmd); }
protected void SendActivateRead(Pipe destination) { Command cmd = new Command(destination, CommandType.ActivateRead); SendCommand (cmd); }
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(); } }
protected void SendTermAck(Own destination) { Command cmd = new Command(destination, CommandType.TermAck); SendCommand (cmd); }
protected void SendOwn(Own destination, Own obj) { destination.IncSeqnum (); Command cmd = new Command(destination, CommandType.Own, obj); SendCommand (cmd); }
protected void SendTermReq(Own destination, Own object_) { Command cmd = new Command(destination, CommandType.TermReq, object_); SendCommand (cmd); }
protected void SendPipeTermAck(Pipe destination) { Command cmd = new Command(destination, CommandType.PipeTermAck); SendCommand (cmd); }
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(); } }
// Send command to the destination thread. public void SendCommand(int tid, Command command) { m_slots[tid].Send(command); }