Пример #1
0
 public void CompleteNow()
 {
     if (iRequest != null)
     {
         try
         {
             iRequest.Complete(ToJsonString());
             Clear();
             iRequest = null;
         }
         catch (SocketException)
         {
             Console.WriteLine("SOCKET EXCEPTION");
             // FIXME: We assume that a SocketException means that
             // the message was not sent, but this is not necessarily
             // the case. We could introduce a more robust protocol
             // to recover from transient errors.
             iRequest = null;
         }
         catch
         {
             iRequest = null;
             throw;
         }
     }
 }
Пример #2
0
 public void AddRequest(PollRequest aRequest)
 {
     if (iRequest != null)
     {
         Debugger.Break();
         aRequest.Complete(new JsonArray { ClashEvent }.ToString());
         return;
     }
     if (iItems.Count > 0)
     {
         try
         {
             aRequest.Complete(ToJsonString());
             Clear();
         }
         catch (SocketException)
         {
             Console.WriteLine("SOCKET EXCEPTION");
             // FIXME: See note in CompleteNow()
         }
     }
     else
     {
         iRequest = aRequest;
     }
 }
Пример #3
0
 public void CancelRequest(PollRequest aRequest)
 {
     if (iRequest == aRequest)
     {
         iRequest = null;
     }
 }
Пример #4
0
 public void CancelRequest(PollRequest aPollRequest)
 {
     iAppsStateThread.ScheduleExclusive(
         () =>
         {
             iEventQueue.CancelRequest(aPollRequest);
             iListener.UpdateTabStatus(SessionId, TabKey, iSession.UserId, iEventQueue.QueueSize, iLastRead, iEventQueue.HasListener);
             RescheduleMaintenance();
         });
 }