diff --git a/tokio-xmpp/src/client/async_client.rs b/tokio-xmpp/src/client/async_client.rs index 4f85185..4cb5228 100644 --- a/tokio-xmpp/src/client/async_client.rs +++ b/tokio-xmpp/src/client/async_client.rs @@ -133,7 +133,10 @@ impl Stream for Client { self.state = ClientState::Connecting(connect); self.poll_next(cx) } - ClientState::Disconnected => Poll::Ready(None), + ClientState::Disconnected => { + self.state = ClientState::Disconnected; + Poll::Pending + } ClientState::Connecting(mut connect) => match Pin::new(&mut connect).poll(cx) { Poll::Ready(Ok(Ok(stream))) => { let bound_jid = stream.jid.clone();