Esempio n. 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;
 }
 public void Abort()
 {
     // We don't want to throw an ODE until the app func actually completes.
     if (_state != ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Aborted;
     }
 }
 public void StartAcceptingWrites()
 {
     // Only start if not aborted
     if (_state == ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Open;
     }
 }
Esempio n. 4
0
 public void StartAcceptingReads(MessageBody body)
 {
     // Only start if not aborted
     if (_state == ProtoStreamState.Closed)
     {
         _state = ProtoStreamState.Open;
         _body  = body;
     }
 }
Esempio n. 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;
     }
 }
Esempio n. 6
0
 public ProtoRequestPipeReader()
 {
     _state = ProtoStreamState.Closed;
 }
 public ProtoResponsePipeWriter(IProtoResponseControl pipeControl)
 {
     _pipeControl = pipeControl;
     _state = ProtoStreamState.Closed;
 }