private void doOnMessage(List<?> messages, CometClientTransportWrapper transport) { if (transport == primaryTransport) { listener.onMessage(messages); } else if (RefreshState.PRIMARY_DISCONNECTED.equals(refreshState)) { refreshEnqueue(messages); } }
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"); } }