void reconnect() { try { createTransport(new LoginHandler(new Callback<Void>() { public void onSuccess(Void value) {
void reconnect() { try { createTransport(new LoginHandler(new Callback<Void>() { public void onSuccess(Void value) {
public void connect(final Callback<Void> cb) { assert cb !=null : "Callback should not be null."; if( transport!=null ) { cb.onFailure(new IllegalStateException("Already connected")); return; } try { createTransport(new LoginHandler(cb, true)); } catch (Throwable e) { // This error happens when the MQTT config is invalid, reattempting // wont fix this case. cb.onFailure(e); } }
public void onFailure(Throwable value) { // Socket failure, should we try to reconnect? if( !disconnected && tryReconnect() ) { reconnect(this); } else { // nope. cb.onFailure(value); } } }
@Override public void onTransportFailure(IOException error) { mqtt.tracer.debug("Transport failure: %s", error); transport.stop(NOOP); onFailure(error); }
public void connect(final Callback<Void> cb) { assert cb !=null : "Callback should not be null."; if( transport!=null ) { cb.onFailure(new IllegalStateException("Already connected")); return; } try { createTransport(new LoginHandler(cb, true)); } catch (Throwable e) { // This error happens when the MQTT config is invalid, reattempting // wont fix this case. cb.onFailure(e); } }
public void onFailure(Throwable value) { // Socket failure, should we try to reconnect? if( !disconnected && tryReconnect() ) { reconnect(this); } else { // nope. cb.onFailure(value); } } }
@Override public void onTransportFailure(IOException error) { mqtt.tracer.debug("Transport failure: %s", error); transport.stop(NOOP); onFailure(error); }