Exemplo n.º 1
0
        public bool Process(BaseRequest message, Stream eventStream, Stream outStream)
        {
            try
            {
                if (requestService.IsQuitMessage(message))
                {
                    responseService.ReturnEmptyResponse(outStream, message);
                    return(true);
                }
                if (requestService.CanHandleMessage(mediaPlayer, message, outStream))
                {
                    return(false);
                }

                logger.LogWarning($"Invalid message type: {message.GetType()}");
                responseService.ReturnResultResponse(outStream, message, false);

                throw new InvalidCastException($"Invalid message type: {message.GetType()}");
            }
            catch (InvalidCastException) { }

            return(false);
        }