Are you sure that you don't have multiple client objects?
This is the internal code that raises the error that you see:
public void sendNoWait(MqttWireMessage message, MqttToken token) throws MqttException {
final String methodName = "sendNoWait";
if (isConnected() ||
(!isConnected() && message instanceof MqttConnect) ||
(isDisconnecting() && message instanceof MqttDisconnect)) {
this.internalSend(message, token);
} else {
throw ExceptionHelper.createMqttException(MqttException.REASON_CODE_CLIENT_NOT_CONNECTED); <--------------------------
}
}
It calls isConnected() to check whether the client is connected. This is the same method that is called when you check Client.Connected.
My guess is that the problem is somewhere else.