【发布时间】:2016-06-26 09:47:36
【问题描述】:
在我的应用程序中,我通过 Paho MQTT 发送消息,我必须等待响应才能发送新消息。
例如:
while (!exit){
sendMessage(); //sends message via Paho MQTT
myMqttConnection.run() //starts a thread to wait for Response via Paho MQTT
//what to do to hold this thread till a message has arrived?
}
sendMessage() 和 myMqttConnection 是两个不同的主题,以防万一
【问题讨论】:
标签: java multithreading mqtt paho