-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
MRE
use paho_mqtt::AsyncClient;
use paho_mqtt::ConnectOptionsBuilder;
use paho_mqtt::CreateOptions;
use paho_mqtt::Error;
#[tokio::main]
async fn main() -> Result<(), Error> {
let client = AsyncClient::new(CreateOptions::default())?;
println!("First one connecting");
client
.connect(
ConnectOptionsBuilder::new()
.server_uris(&["test.mosquitto.org:1883"])
.finalize(),
)
.await?;
println!("Fist one connected");
println!("Second one connecting");
client
.connect(
ConnectOptionsBuilder::new()
.server_uris(&["test.mosquitto.org:1883"])
.finalize(),
)
.await?;
println!("Second one connected");
Ok(())
}First one connecting
Fist one connected
Second one connectingrepr-async-client-stuck-double-connect.zip
Current behavior
Connecting twice to the same broker causes AsyncClient to get stuck on the second connect call.
Expected behaviour
Second connect call should be ignored, as it is already connected.
Additional information
Setting different protocols doesn't change anything
Reactions are currently unavailable