Пример #1
0
 private void doOnMessage(List<?> messages, CometClientTransportWrapper transport) {
   if (transport == primaryTransport) {
     listener.onMessage(messages);
   } else if (RefreshState.PRIMARY_DISCONNECTED.equals(refreshState)) {
     refreshEnqueue(messages);
   }
 }
Пример #2
0
  private void doOnRefresh(CometClientTransportWrapper transport) {
    if (refreshState == null && transport == primaryTransport) {
      refreshState = RefreshState.CONNECTING;

      if (refreshTransport == null) {
        refreshTransport = new CometClientTransportWrapper();
      }
      refreshTransport.connect();

      listener.onRefresh();
    } else if (transport == refreshTransport) {
      refreshEnqueue(REFRESH);
    } else {
      throw new IllegalStateException("Unexpected refresh from primaryTransport");
    }
  }