Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
 public ClientStream(INetworkObserver networkObserver)
 {
     networkObserver.OnCancel = _cancelTokenSource.Cancel;
     networkObserver.OnClose = OnClose;
     networkObserver.OnWrite = OnWrite;
 }
Пример #4
0
 public ClientStream(INetworkObserver networkObserver)
 {
     networkObserver.OnCancel = _cancelTokenSource.Cancel;
     networkObserver.OnClose  = OnClose;
     networkObserver.OnWrite  = OnWrite;
 }