protected override void OnError(ErrorEventArgs e) {
            base.OnError(e);

            var ex = e.Exception;
            if (ex == null) {
                ex = new MessageTransportException();
            } else if (ex is SocketException || ex is WebSocketException) {
                ex = new MessageTransportException(ex);
            } 

            _incomingMessages.Post(Task.FromException<string>(ex));
        }
Пример #2
0
        protected override void OnError(ErrorEventArgs e)
        {
            base.OnError(e);

            var ex = e.Exception;

            if (ex == null)
            {
                ex = new MessageTransportException();
            }
            else if (ex is SocketException || ex is WebSocketException)
            {
                ex = new MessageTransportException(ex);
            }

            _incomingMessages.Post(Task.FromException <string>(ex));
        }