I’ve stumbled into a catch-22 – When connecting to an XMPP server, Connection.connect() must be called with a valid server before Connection.login(…). However, I’m using a custom SASL mechanism that fetches the xmpp server along with login token from a well-known address as part of the handshake, but login() never gets that far because of the state of the Connection.
I could move the server-finding logic out of the SASL mechanism and figure that part out before calling connect(). But that seems a little dirty. Is there a better way to handle this situation?