Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 public ClientStream(INetworkObserver networkObserver)
 {
     networkObserver.OnCancel = _cancelTokenSource.Cancel;
     networkObserver.OnClose = OnClose;
     networkObserver.OnWrite = OnWrite;
 }
Exemplo n.º 4
0
 public ClientStream(INetworkObserver networkObserver)
 {
     networkObserver.OnCancel = _cancelTokenSource.Cancel;
     networkObserver.OnClose  = OnClose;
     networkObserver.OnWrite  = OnWrite;
 }