예제 #1
0
파일: ServerTab.cs 프로젝트: weeble/ohos
 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
파일: ServerTab.cs 프로젝트: weeble/ohos
 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
파일: ServerTab.cs 프로젝트: weeble/ohos
 public void CancelRequest(PollRequest aRequest)
 {
     if (iRequest == aRequest)
     {
         iRequest = null;
     }
 }
예제 #4
0
파일: ServerTab.cs 프로젝트: weeble/ohos
 public void CancelRequest(PollRequest aPollRequest)
 {
     iAppsStateThread.ScheduleExclusive(
         () =>
         {
             iEventQueue.CancelRequest(aPollRequest);
             iListener.UpdateTabStatus(SessionId, TabKey, iSession.UserId, iEventQueue.QueueSize, iLastRead, iEventQueue.HasListener);
             RescheduleMaintenance();
         });
 }