final CallbackConnection connection = mqtt.callbackConnection();
connection.listener(new Listener() {
public void onDisconnected() {
}
public void onConnected() {
}
public void onPublish(UTF8Buffer topic, Buffer payload, Runnable ack) {
// You can now process a received message from a topic.
// Once process execute the ack runnable.
ack.run();
}
public void onFailure(Throwable value) {
connection.close(null); // a connection failure occured.
}
});
connection.connect(new Callback<Void>() {
public void onFailure(Throwable value) {
result.failure(value); // If we could not connect to the server.
}
connection.close(null);
result.failure(value);
In the project , connection doesn't have a method called close
result varible is not defined
the code in the reamme like that :
final CallbackConnection connection = mqtt.callbackConnection(); connection.listener(new Listener() {
connection.close(null); result.failure(value);
In the project , connection doesn't have a method called close result varible is not defined
what's wrong?