Package org.eclipse.paho.client.mqttv3

Examples of org.eclipse.paho.client.mqttv3.MqttClient.disconnect()


        client.publish("test", "hello".getBytes(), 1, false);

        Message msg = consumer.receive(100 * 5);
        assertNotNull(msg);

        client.disconnect();
        client.close();
    }


}
View Full Code Here


                        sendBarrier.await();
                        for( int i=0; i < 10; i++) {
                           Thread.sleep(1000);
                           client.publish("test", "hello".getBytes(), 1, false);
                        }
                        client.disconnect();
                        client.close();
                    } catch (Throwable e) {
                        e.printStackTrace();
                        asyncError.set(e);
                    } finally {
View Full Code Here

      }
      catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new IllegalStateException(e);
      }
      client.disconnect();
      client.close();
    }
    catch (MqttException mqttException) {
      throw new IllegalStateException(mqttException.getMessage());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.