AspComet.CometAsyncResult.CompleteRequestWithMessages C# (CSharp) Метод

CompleteRequestWithMessages() публичный Метод

public CompleteRequestWithMessages ( IEnumerable responseMessages ) : void
responseMessages IEnumerable
Результат void
        public void CompleteRequestWithMessages(IEnumerable<Message> responseMessages)
        {
            // Quick explanation of how this works.  This will be called to send the response back, the callback
            // will go back to the CometHttpHandler's EndProcessRequest() which will then call SendAwaitingMessages()
            this.responseMessages = responseMessages;
            this.IsCompleted = true;
            this.callback(this);
        }

Usage Example

Пример #1
0
        public void HandleMessages(Message[] messages, CometAsyncResult asyncResult)
        {
            // Do this before we process the messages in case it's a disconnect
            Client sendingClient = GetSenderOf(messages);

            IMessagesProcessor processor = this.CreateProcessorAndProcess(messages);

            if (sendingClient == null)
            {
                asyncResult.CompleteRequestWithMessages(processor.Result);
                return;
            }

            if (sendingClient.CurrentAsyncResult != null)
            {
                sendingClient.FlushQueue();
            }

            sendingClient.CurrentAsyncResult = asyncResult;
            sendingClient.Enqueue(processor.Result);

            if (processor.ShouldSendResultStraightBackToClient)
            {
                sendingClient.FlushQueue();
            }
        }
All Usage Examples Of AspComet.CometAsyncResult::CompleteRequestWithMessages