eventBus.fireEventFromSource(new ConnectionStatusChangedEvent(ConnectionStatus.error, "Connection error: " + error.toString()), this);
disconnect();
} else {
final int scedTime = RetryControl.retry(e);
eventBus.fireEventFromSource(new ConnectionStatusChangedEvent(ConnectionStatus.waitingForRetry, "The connection will try to re-connect in " + scedTime + " milliseconds.", scedTime), this);
Platform.schedule(scedTime, new ScheduledAction() {
@Override
public void run() {
logger.info("Error retry: " + e);
send(request);
}