示例#1
0
        /// <summary>
        /// Flush the messages downstream.
        /// </summary>
        public void Flush()
        {
            // The peer does not exist anymore at this point.
            if (m_state == State.Terminating)
            {
                return;
            }

            if (m_outboundPipe != null && !m_outboundPipe.Flush())
            {
                SendActivateRead(m_peer);
            }
        }
示例#2
0
文件: Mailbox.cs 项目: wbskyboy/netmq
        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);
            }
        }
示例#3
0
文件: Mailbox.cs 项目: wbskyboy/netmq
        /// <summary>
        /// Send the given Command out across the command-pipe.
        /// </summary>
        /// <param name="cmd">the Command to send</param>
        public void Send(Command cmd)
        {
            bool ok;

            lock (m_sync)
            {
                m_commandPipe.Write(ref cmd, false);
                ok = m_commandPipe.Flush();
            }

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

            if (!ok)
            {
                m_signaler.Send();
            }
        }
示例#4
0
        public void Send(Command cmd)
        {
            lock (m_sync)
            {
                m_commandPipe.Write(ref cmd, false);
                bool ok = m_commandPipe.Flush();

                if (!ok)
                {
                    Monitor.PulseAll(m_sync);

                    foreach (var signaler in m_signalers)
                    {
                        signaler.Send();
                    }
                }
            }
        }