public ClientStream(INetworkObserver networkObserver, SafeCancellationTokenSource callCancelledTokenSource) { _cancelToken = _cancelTokenSource.Token; _callCancelledTokenSource = callCancelledTokenSource; networkObserver.OnCancel = () => { _cancelTokenSource.Cancel(useNewThread: false); _callCancelledTokenSource.Cancel(); }; networkObserver.OnClose = OnClose; networkObserver.OnWrite = OnWrite; }
public ClientStream(INetworkObserver networkObserver) { networkObserver.OnCancel = _cancelTokenSource.Cancel; networkObserver.OnClose = OnClose; networkObserver.OnWrite = OnWrite; }