当前位置: 首页>>代码示例>>C#>>正文


C# zmq.Pipe类代码示例

本文整理汇总了C#中NetMQ.zmq.Pipe的典型用法代码示例。如果您正苦于以下问题:C# Pipe类的具体用法?C# Pipe怎么用?C# Pipe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Pipe类属于NetMQ.zmq命名空间,在下文中一共展示了Pipe类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XAttachPipe

        protected override void XAttachPipe(Pipe pipe, bool icanhasall)
        {
            Debug.Assert(pipe != null);

            //  ZMQ_PAIR socket can only be connected to a single peer.
            //  The socket rejects any further connection requests.
            if (m_pipe == null)
                m_pipe = pipe;
            else
                pipe.Terminate (false);
        }
开发者ID:GianniBortoloBossini,项目名称:netmq,代码行数:11,代码来源:Pair.cs

示例2: Activated

        //  Activates pipe that have previously reached high watermark.
        public void Activated(Pipe pipe)
        {
            //  Move the pipe from passive to eligible state.
            Utils.Swap (m_pipes, m_pipes.IndexOf (pipe), m_eligible);
            m_eligible++;

            //  If there's no message being sent at the moment, move it to
            //  the active state.
            if (!m_more) {
                Utils.Swap (m_pipes, m_eligible - 1, m_active);
                m_active++;
            }
        }
开发者ID:jasenkin,项目名称:netmq,代码行数:14,代码来源:Dist.cs

示例3: Terminated

 //  Removes the pipe from the distributor object.
 public void Terminated(Pipe pipe)
 {
     //  Remove the pipe from the list; adjust number of matching, active and/or
     //  eligible pipes accordingly.
     if (m_pipes.IndexOf (pipe) < m_matching)
         m_matching--;
     if (m_pipes.IndexOf (pipe) < m_active)
         m_active--;
     if (m_pipes.IndexOf (pipe) < m_eligible)
         m_eligible--;
     m_pipes.Remove(pipe);
 }
开发者ID:jasenkin,项目名称:netmq,代码行数:13,代码来源:Dist.cs

示例4: SendPipeTermAck

 protected void SendPipeTermAck(Pipe destination)
 {
     Command cmd = new Command(destination, CommandType.PipeTermAck);
     SendCommand (cmd);
 }
开发者ID:oskarwkarlsson,项目名称:netmq,代码行数:5,代码来源:ZObject.cs

示例5: SendBind

        protected void SendBind(Own destination, Pipe pipe,
		                          bool incSeqnum)
        {
            if (incSeqnum)
                destination.IncSeqnum ();

            Command cmd = new Command(destination, CommandType.Bind, pipe);
            SendCommand (cmd);
        }
开发者ID:oskarwkarlsson,项目名称:netmq,代码行数:9,代码来源:ZObject.cs

示例6: SendActivateWrite

        protected void SendActivateWrite(Pipe destination,
		                                    long msgsRead)
        {
            Command cmd = new Command(destination, CommandType.ActivateWrite, msgsRead);
            SendCommand (cmd);
        }
开发者ID:oskarwkarlsson,项目名称:netmq,代码行数:6,代码来源:ZObject.cs

示例7: ProcessBind

 protected virtual void ProcessBind(Pipe pipe)
 {
     throw new NotSupportedException();
 }
开发者ID:oskarwkarlsson,项目名称:netmq,代码行数:4,代码来源:ZObject.cs

示例8: XTerminated

        protected override void XTerminated(Pipe pipe)
        {
            //  Remove the pipe from the trie. If there are topics that nobody
            //  is interested in anymore, send corresponding unsubscriptions
            //  upstream.

            m_subscriptions.RemoveHelper(pipe, s_SendUnsubscription, this);

            m_dist.Terminated(pipe);
        }
开发者ID:EugenDueck,项目名称:netmq,代码行数:10,代码来源:XPub.cs

示例9: Terminated

        public void Terminated(Pipe pipe)
        {
            //  Drop the reference to the deallocated pipe.
            Debug.Assert(m_pipe == pipe || m_terminatingPipes.Contains(pipe));

            if (m_pipe == pipe)
                // If this is our current pipe, remove it
                m_pipe = null;
            else
                // Remove the pipe from the detached pipes set
                m_terminatingPipes.Remove(pipe);

            if (!IsTerminating && m_options.RawSocket)
            {
                if (m_engine != null)
                {
                    m_engine.Terminate();
                    m_engine = null;
                }
                Terminate();
            }

            //  If we are waiting for pending messages to be sent, at this point
            //  we are sure that there will be no more messages and we can proceed
            //  with termination safely.
            if (m_pending && m_pipe == null && m_terminatingPipes.Count == 0)
                ProceedWithTerm();
        }
开发者ID:JayShelton,项目名称:netmq,代码行数:28,代码来源:SessionBase.cs

示例10: ReadActivated

        public void ReadActivated(Pipe pipe)
        {
            // Skip activating if we're detaching this pipe
            if (m_pipe != pipe)
            {
                Debug.Assert(m_terminatingPipes.Contains(pipe));
                return;
            }

            if (m_engine != null)
                m_engine.ActivateOut();
            else
                m_pipe.CheckRead();
        }
开发者ID:JayShelton,项目名称:netmq,代码行数:14,代码来源:SessionBase.cs

示例11: Hiccuped

 public void Hiccuped(Pipe pipe)
 {
     //  Hiccups are always sent from session to socket, not the other
     //  way round.
     throw new NotSupportedException("Must Override");
 }
开发者ID:JayShelton,项目名称:netmq,代码行数:6,代码来源:SessionBase.cs

示例12: AttachPipe

 //  To be used once only, when creating the session.
 public void AttachPipe(Pipe pipe)
 {
     Debug.Assert(!IsTerminating);
     Debug.Assert(m_pipe == null);
     Debug.Assert(pipe != null);
     m_pipe = pipe;
     m_pipe.SetEventSink(this);
 }
开发者ID:JayShelton,项目名称:netmq,代码行数:9,代码来源:SessionBase.cs

示例13: Attach

 //  Adds the pipe to the distributor object.
 public void Attach(Pipe pipe)
 {
     //  If we are in the middle of sending a message, we'll add new pipe
     //  into the list of eligible pipes. Otherwise we add it to the list
     //  of active pipes.
     if (m_more) {
         m_pipes.Add (pipe);
         //pipes.swap (eligible, pipes.size () - 1);
         Utils.Swap(m_pipes, m_eligible, m_pipes.Count - 1);
         m_eligible++;
     }
     else {
         m_pipes.Add (pipe);
         //pipes.swap (active, pipes.size () - 1);
         Utils.Swap(m_pipes, m_active, m_pipes.Count - 1);
         m_active++;
         m_eligible++;
     }
 }
开发者ID:jasenkin,项目名称:netmq,代码行数:20,代码来源:Dist.cs

示例14: Write

 //  Write the message to the pipe. Make the pipe inactive if writing
 //  fails. In such a case false is returned.
 private bool Write(Pipe pipe, Msg msg)
 {
     if (!pipe.Write (msg)) {
         Utils.Swap(m_pipes, m_pipes.IndexOf (pipe), m_matching - 1);
         m_matching--;
         Utils.Swap(m_pipes, m_pipes.IndexOf (pipe), m_active - 1);
         m_active--;
         Utils.Swap(m_pipes, m_active, m_eligible - 1);
         m_eligible--;
         return false;
     }
     if (!msg.HasMore)
         pipe.Flush ();
     return true;
 }
开发者ID:jasenkin,项目名称:netmq,代码行数:17,代码来源:Dist.cs

示例15: XAttachPipe

        protected override void XAttachPipe(Pipe pipe, bool icanhasall)
        {
            Debug.Assert(pipe != null);
            m_dist.Attach(pipe);

            //  If icanhasall_ is specified, the caller would like to subscribe
            //  to all data on this pipe, implicitly.
            if (icanhasall)
                m_subscriptions.Add(null, pipe);

            //  The pipe is active when attached. Let's read the subscriptions from
            //  it, if any.
            XReadActivated(pipe);
        }
开发者ID:EugenDueck,项目名称:netmq,代码行数:14,代码来源:XPub.cs


注:本文中的NetMQ.zmq.Pipe类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。