question: protected void subscribe ( ) throws IOException { if ( sampleClientSub == null ) { try { sampleClientSub = new SampleAsyncWait ( url , clientIdSub , cleanSession , quietMode , userName , password ) ; } catch ( MqttException e ) { e . printStackTrace ( ) ; } } if ( sampleClientSub != null ) { String topic = "Sample/#" ; int qos = 2 ; try { sampleClientSub . subscribe ( topic , qos ) ; } catch ( Throwable e ) { e . printStackTrace ( ) ; } } }
target:  Subscribe to a topic on an MQTT server Once subscribed this method waits for the messages to arrive from the server  that match the subscription. It continues listening for messages until pin 3 is pressed