コード例 #1
0
 public MyDisposable(StreamRpcServerHandler owner, CancellationTokenSource readerCts, MessageWriter writer)
 {
     Debug.Assert(owner != null);
     Debug.Assert(readerCts != null || writer != null);
     this.owner     = owner;
     this.readerCts = readerCts;
     this.writer    = writer;
 }
コード例 #2
0
 /// <inheritdoc />
 public void Dispose()
 {
     if (owner == null)
     {
         return;
     }
     readerCts?.Cancel();
     if (owner.writer == writer)
     {
         owner.writer = null;
     }
     readerCts = null;
     writer    = null;
     owner     = null;
 }
コード例 #3
0
 public RequestCancellationFeature(StreamRpcServerHandler owner)
 {
     Debug.Assert(owner != null);
     _Owner = owner;
 }