public void ExecNextCmd(EAnpChannel c) { if (CmdQueue.Count == 0) { Tell("All commands executed"); return; } AnpMsg cmd = CmdQueue.Dequeue(); Tell("Running command " + (EAnpCmd)cmd.Type); EAnpOutgoingQuery q = c.SendCmd(cmd); if (q == null) return; q.OnCompletion += HandleOutcomingCompletion; }
public WmEAnpChannel(EAnpChannel c) { Channel = c; c.OnIncomingQuery += HandleIncomingQuery; }
public EAnpIncomingQuery(EAnpChannel channel, AnpMsg cmd) : base(channel, cmd) { }
public EAnpOutgoingQuery(EAnpChannel channel, AnpMsg cmd) : base(channel, cmd) { }
public EAnpChannelOpenEventArgs(EAnpChannel channel) { Channel = channel; }
public EAnpIncomingEventEventArgs(EAnpChannel channel, AnpMsg msg) { Channel = channel; Msg = msg; }
public EAnpBaseQuery(EAnpChannel channel, AnpMsg cmd) { Channel = channel; Cmd = cmd; }
/// <summary> /// Called by broker channel to unlink the channel. /// </summary> public void InternalUnlinkChannel(EAnpChannel channel) { m_channelTree.Remove(channel.InternalChannelID); }
/// <summary> /// Called by broker channel to send a message to a thread channel. /// </summary> public void InternalSendMsg(EAnpChannel channel, AnpMsg msg) { if (m_thread == null) return; m_thread.InvokeWorker(new Action<UInt64, AnpMsg>(m_thread.RequestSendMsg), new object[] { channel.InternalChannelID, msg }); }
/// <summary> /// Called by broker channel to close the thread channel. /// </summary> public void InternalCloseThreadChannel(EAnpChannel channel) { if (m_thread == null) return; m_thread.InvokeWorker(new Action<UInt64>(m_thread.RequestCloseChannel), new object[] { channel.InternalChannelID }); }
/// <summary> /// Called by the worker thread when a channel has been opened. /// </summary> public void InternalChannelOpened(UInt64 channelID) { if (m_thread == null || m_thread.CancelFlag) return; EAnpChannel c = new EAnpChannel(this, channelID); m_channelTree[c.InternalChannelID] = c; if (OnChannelOpen != null) OnChannelOpen(this, new EAnpChannelOpenEventArgs(c)); }