void onSessionError(ApplicationError error, String closeReason) { boolean reconnectAllowed = !stateController.clientConfig().closeClientOnErrors(); if (!reconnectAllowed) { // Record the error that happened during the session stateController.setCloseError(error); } closeSession(error, closeReason, reconnectAllowed); }
void handleSessionError(ApplicationError error, String closeReason) { boolean reconnectAllowed = !stateController.clientConfig().closeClientOnErrors(); if (!reconnectAllowed) { // Record the error that happened during the session stateController.setCloseError(error); } closeIncompleteSession(error, closeReason, reconnectAllowed); }
void handleSessionError(ApplicationError error, String closeReason) { boolean reconnectAllowed = !stateController.clientConfig().closeClientOnErrors(); if (!reconnectAllowed) { // Record the error that happened during the session stateController.setCloseError(error); } closeIncompleteSession(error, closeReason, reconnectAllowed); }
void handleSessionError(ApplicationError error, String closeReason) { boolean reconnectAllowed = !stateController.clientConfig().closeClientOnErrors(); if (!reconnectAllowed) { // Record the error that happened during the session stateController.setCloseError(error); } closeIncompleteSession(error, closeReason, reconnectAllowed); }
void onSessionError(ApplicationError error, String closeReason) { boolean reconnectAllowed = !stateController.clientConfig().closeClientOnErrors(); if (!reconnectAllowed) { // Record the error that happened during the session stateController.setCloseError(error); } closeSession(error, closeReason, reconnectAllowed); }
void onSessionError(ApplicationError error, String closeReason) { boolean reconnectAllowed = !stateController.clientConfig().closeClientOnErrors(); if (!reconnectAllowed) { // Record the error that happened during the session stateController.setCloseError(error); } closeSession(error, closeReason, reconnectAllowed); }
@Override public void onEnter(ClientState lastState) { if (lastState instanceof InitialState) { stateController.setExternalState(new WampClient.ConnectingState()); } // Check for valid number of connects assert (nrConnectAttempts != 0); // Decrease remaining number of reconnects if it's not infinite if (nrConnectAttempts > 0) nrConnectAttempts--; // Starts an connection attempt to the router connectionController = new QueueingConnectionController(stateController.scheduler(), new ClientConnectionListener(stateController)); try { connectingCon = stateController.clientConfig().connector().connect(stateController.scheduler(), this, connectionController); } catch (Exception e) { // Catch exceptions that can happen during creating the channel // These are normally signs that something is wrong with our configuration // Therefore we don't trigger retries stateController.setCloseError(e); stateController.setExternalState(new WampClient.DisconnectedState(e)); DisconnectedState newState = new DisconnectedState(stateController, e); // This is a reentrant call to setState. However it works as onEnter is the last call in setState stateController.setState(newState); } }
@Override public void onEnter(ClientState lastState) { if (lastState instanceof InitialState) { stateController.setExternalState(new WampClient.ConnectingState()); } // Check for valid number of connects assert (nrConnectAttempts != 0); // Decrease remaining number of reconnects if it's not infinite if (nrConnectAttempts > 0) nrConnectAttempts--; // Starts an connection attempt to the router connectionController = new QueueingConnectionController(stateController.scheduler(), new ClientConnectionListener(stateController)); try { connectingCon = stateController.clientConfig().connector().connect(stateController.scheduler(), this, connectionController); } catch (Exception e) { // Catch exceptions that can happen during creating the channel // These are normally signs that something is wrong with our configuration // Therefore we don't trigger retries stateController.setCloseError(e); stateController.setExternalState(new WampClient.DisconnectedState(e)); DisconnectedState newState = new DisconnectedState(stateController, e); // This is a reentrant call to setState. However it works as onEnter is the last call in setState stateController.setState(newState); } }
@Override public void onEnter(ClientState lastState) { if (lastState instanceof InitialState) { stateController.setExternalState(new WampClient.ConnectingState()); } // Check for valid number of connects assert (nrConnectAttempts != 0); // Decrease remaining number of reconnects if it's not infinite if (nrConnectAttempts > 0) nrConnectAttempts--; // Starts an connection attempt to the router connectionController = new QueueingConnectionController(stateController.scheduler(), new ClientConnectionListener(stateController)); try { connectingCon = stateController.clientConfig().connector().connect(stateController.scheduler(), this, connectionController); } catch (Exception e) { // Catch exceptions that can happen during creating the channel // These are normally signs that something is wrong with our configuration // Therefore we don't trigger retries stateController.setCloseError(e); stateController.setExternalState(new WampClient.DisconnectedState(e)); DisconnectedState newState = new DisconnectedState(stateController, e); // This is a reentrant call to setState. However it works as onEnter is the last call in setState stateController.setState(newState); } }