Example #1
0
        protected bool SetState(ChannelStateType state)
        {
            if (_state == state)
            {
                return(false);
            }

            _state = state;
            StateChanged?.Invoke(this, state);

            if (state == ChannelStateType.Closed)
            {
                MakeAllRequestsGetException(new RequestChannelException());
            }

            return(true);
        }
Example #2
0
 public ChannelBase(ILog logger)
 {
     _state  = ChannelStateType.Closed;
     _logger = logger;
 }