Open Altair-Bueno opened 2 months ago
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 connecting
repr-async-client-stuck-double-connect.zip
Connecting twice to the same broker causes AsyncClient to get stuck on the second connect call.
connect
Second connect call should be ignored, as it is already connected.
Setting different protocols doesn't change anything
MRE
repr-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