@Override public void onCompletion(IWampConnectionFuture<Void> future) { // Is called once the disconnect from the previous transport has happened if (nrReconnectAttempts == 0) { DisconnectedState newState = new DisconnectedState(stateController, null); stateController.setState(newState); } else { WaitingForReconnectState newState = new WaitingForReconnectState(stateController, nrReconnectAttempts); stateController.setState(newState); } }
@Override public void onCompletion(IWampConnectionFuture<Void> future) { // Is called once the disconnect from the previous transport has happened if (nrReconnectAttempts == 0) { DisconnectedState newState = new DisconnectedState(stateController, null); stateController.setState(newState); } else { WaitingForReconnectState newState = new WaitingForReconnectState(stateController, nrReconnectAttempts); stateController.setState(newState); } }
@Override public void onCompletion(IWampConnectionFuture<Void> future) { // Is called once the disconnect from the previous transport has happened if (nrReconnectAttempts == 0) { DisconnectedState newState = new DisconnectedState(stateController, null); stateController.setState(newState); } else { WaitingForReconnectState newState = new WaitingForReconnectState(stateController, nrReconnectAttempts); stateController.setState(newState); } }
@Override public void run() { if (!isCancelled) { // Try reconnect if possible, otherwise announce close if (nrConnectAttempts != 0) { // Reconnect is allowed WaitingForReconnectState nextState = new WaitingForReconnectState(stateController, nrConnectAttempts); stateController.setState(nextState); } else { stateController.setExternalState(new WampClient.DisconnectedState(cause)); DisconnectedState nextState = new DisconnectedState(stateController, cause); stateController.setState(nextState); } } else { // Connection cancel attempt was successfully cancelled. // This is the final state stateController.setExternalState(new WampClient.DisconnectedState(null)); DisconnectedState nextState = new DisconnectedState(stateController, null); stateController.setState(nextState); } } });
@Override public void run() { if (!isCancelled) { // Try reconnect if possible, otherwise announce close if (nrConnectAttempts != 0) { // Reconnect is allowed WaitingForReconnectState nextState = new WaitingForReconnectState(stateController, nrConnectAttempts); stateController.setState(nextState); } else { stateController.setExternalState(new WampClient.DisconnectedState(cause)); DisconnectedState nextState = new DisconnectedState(stateController, cause); stateController.setState(nextState); } } else { // Connection cancel attempt was successfully cancelled. // This is the final state stateController.setExternalState(new WampClient.DisconnectedState(null)); DisconnectedState nextState = new DisconnectedState(stateController, null); stateController.setState(nextState); } } });
@Override public void run() { if (!isCancelled) { // Try reconnect if possible, otherwise announce close if (nrConnectAttempts != 0) { // Reconnect is allowed WaitingForReconnectState nextState = new WaitingForReconnectState(stateController, nrConnectAttempts); stateController.setState(nextState); } else { stateController.setExternalState(new WampClient.DisconnectedState(cause)); DisconnectedState nextState = new DisconnectedState(stateController, cause); stateController.setState(nextState); } } else { // Connection cancel attempt was successfully cancelled. // This is the final state stateController.setExternalState(new WampClient.DisconnectedState(null)); DisconnectedState nextState = new DisconnectedState(stateController, null); stateController.setState(nextState); } } });