Ejemplo n.º 1
0
 ///<remarks> Constructor is private as pipe can only be created using <see cref="PipePair"/> method. </remarks>
 private Pipe(ZObject parent, YPipe <Msg> inboundPipe, YPipe <Msg> outboundPipe,
              int inHighWatermark, int outHighWatermark, bool delay)
     : base(parent)
 {
     m_parent                  = parent;
     m_inboundPipe             = inboundPipe;
     m_outboundPipe            = outboundPipe;
     m_inActive                = true;
     m_outActive               = true;
     m_highWatermark           = outHighWatermark;
     m_lowWatermark            = ComputeLowWatermark(inHighWatermark);
     m_numberOfMessagesRead    = 0;
     m_numberOfMessagesWritten = 0;
     m_peersMsgsRead           = 0;
     m_peer  = null;
     m_sink  = null;
     m_state = State.Active;
     m_delay = delay;
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Create a new Pipe object with the given parent, and inbound and outbound YPipes.
 /// </summary>
 /// <remarks>
 ///     Constructor is private as pipe can only be created using <see cref="PipePair" /> method.
 /// </remarks>
 private Pipe(
     [NotNull] ZObject parent, [NotNull] YPipe <Msg> inboundPipe, [NotNull] YPipe <Msg> outboundPipe,
     int inHighWatermark, int outHighWatermark, int predefinedLowWatermark, bool delay)
     : base(parent)
 {
     this.m_parent                  = parent;
     this.m_inboundPipe             = inboundPipe;
     this.m_outboundPipe            = outboundPipe;
     this.m_inActive                = true;
     this.m_outActive               = true;
     this.m_highWatermark           = outHighWatermark;
     this.m_lowWatermark            = Pipe.ComputeLowWatermark(inHighWatermark, predefinedLowWatermark);
     this.m_numberOfMessagesRead    = 0;
     this.m_numberOfMessagesWritten = 0;
     this.m_peersMsgsRead           = 0;
     this.m_peer  = null;
     this.m_sink  = null;
     this.m_state = State.Active;
     this.m_delay = delay;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Specifies the object to send events to.
 /// </summary>
 /// <param name="sink"> The receiver of the events. </param>
 public void SetEventSink([NotNull] IPipeEvents sink)
 {
     Debug.Assert(m_sink == null);
     m_sink = sink;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Specifies the object to send events to.
 /// </summary>
 /// <param name="sink"> The receiver of the events. </param>
 public void SetEventSink([NotNull] IPipeEvents sink)
 {
     Debug.Assert(m_sink == null);
     m_sink = sink;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a new Pipe object with the given parent, and inbound and outbound YPipes.
 /// </summary>
 /// <remarks>
 /// Constructor is private as pipe can only be created using <see cref="PipePair"/> method.
 /// </remarks>
 private Pipe(
     [NotNull] ZObject parent, [NotNull] YPipe<Msg> inboundPipe, [NotNull] YPipe<Msg> outboundPipe,
     int inHighWatermark, int outHighWatermark, int predefinedLowWatermark, bool delay)
     : base(parent)
 {
     m_parent = parent;
     m_inboundPipe = inboundPipe;
     m_outboundPipe = outboundPipe;
     m_inActive = true;
     m_outActive = true;
     m_highWatermark = outHighWatermark;
     m_lowWatermark = ComputeLowWatermark(inHighWatermark, predefinedLowWatermark);
     m_numberOfMessagesRead = 0;
     m_numberOfMessagesWritten = 0;
     m_peersMsgsRead = 0;
     m_peer = null;
     m_sink = null;
     m_state = State.Active;
     m_delay = delay;
 }
Ejemplo n.º 6
0
Archivo: Pipe.cs Proyecto: ezhuo/netmq
        //  Constructor is private. Pipe can only be created using
        //  pipepair function.
        private Pipe(ZObject parent, YPipe<Msg> inpipe, YPipe<Msg> outpipe,
		              int inhwm, int outhwm, bool delay)
            : base(parent)
        {
            m_parent = parent;
            m_inpipe = inpipe;
            m_outpipe = outpipe;
            m_inActive = true;
            m_outActive = true;
            m_hwm = outhwm;
            m_lwm = ComputeLwm (inhwm);
            m_msgsRead = 0;
            m_msgsWritten = 0;
            m_peersMsgsRead = 0;
            m_peer = null ;
            m_sink = null ;
            m_state = State.Active;
            m_delay = delay;
        }