예제 #1
0
 public void StopAcceptingReads()
 {
     // Can't use dispose (or close) as can be disposed too early by user code
     // As exampled in EngineTests.ZeroContentLengthNotSetAutomaticallyForCertainStatusCodes
     _state = ProtoStreamState.Closed;
     _body  = null;
 }
예제 #2
0
 public void Abort()
 {
     // We don't want to throw an ODE until the app func actually completes.
     if (_state != ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Aborted;
     }
 }
예제 #3
0
 public void StartAcceptingWrites()
 {
     // Only start if not aborted
     if (_state == ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Open;
     }
 }
예제 #4
0
 public void StartAcceptingReads(MessageBody body)
 {
     // Only start if not aborted
     if (_state == ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Open;
         _body  = body;
     }
 }
예제 #5
0
 public void Abort(Exception error = null)
 {
     // We don't want to throw an ODE until the app func actually completes.
     // If the request is aborted, we throw a TaskCanceledException instead,
     // unless error is not null, in which case we throw it.
     if (_state != ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Aborted;
         _error = error;
     }
 }
예제 #6
0
 public ProtoRequestPipeReader()
 {
     _state = ProtoStreamState.Closed;
 }
예제 #7
0
 public ProtoResponsePipeWriter(IProtoResponseControl pipeControl)
 {
     _pipeControl = pipeControl;
     _state = ProtoStreamState.Closed;
 }