Beispiel #1
0
 /// <summary>
 /// Sets an acknowledgement callback, and optionally "primes the pump" by calling it to acknowledge 0 bytes.
 /// </summary>
 /// <remarks>It is not necessary to call this if you do not need acknowledgment information.</remarks>
 /// <param name="onack">Acknowledgment callback.</param>
 /// <param name="prime">True to call acknowledgement immediately.</param>
 public void BeginStream(AckDelegate onack, bool prime)
 {
     if (onack == null)
     {
         throw new ArgumentNullException("onack");
     }
     if (this.onAck != null)
     {
         throw new InvalidOperationException("ack delegate already set");
     }
     if (!Consumed)
     {
         throw new InvalidOperationException("cannot stream without a consumer");
     }
     this.onAck = onack;
     ackMutex   = new object();
     if (prime)
     {
         AckInternal(0, true);
     }
 }
Beispiel #2
0
 internal HandshakeRpc(AckDelegate ackDelegate)
 {
     _ackDelegate = ackDelegate;
 }