diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-12 18:12:47 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-12 18:12:47 (GMT) |
| commit | fdd8755e2363e8d706a3d0bdc2e71f234abdf829 (patch) | |
| tree | 470401f6f80873c4e1ce5af5cd30ab6837854d04 /Swiften/Client/Client.h | |
| parent | 6a20be61e229255f93d55f13be3346525698237a (diff) | |
| download | swift-fdd8755e2363e8d706a3d0bdc2e71f234abdf829.zip swift-fdd8755e2363e8d706a3d0bdc2e71f234abdf829.tar.bz2 | |
Refactored DNS handling.
Connections now fallback on other DNS entries upon failure,
taking into account SRV priorities.
Diffstat (limited to 'Swiften/Client/Client.h')
| -rw-r--r-- | Swiften/Client/Client.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 3f7d350..f09c916 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -1,12 +1,13 @@ #ifndef SWIFTEN_Client_H #define SWIFTEN_Client_H #include <boost/signals.hpp> #include <boost/shared_ptr.hpp> +#include "Swiften/Network/PlatformDomainNameResolver.h" #include "Swiften/Base/Error.h" #include "Swiften/Client/ClientSession.h" #include "Swiften/Client/ClientError.h" #include "Swiften/Elements/Presence.h" #include "Swiften/Elements/Message.h" #include "Swiften/JID/JID.h" @@ -19,12 +20,13 @@ namespace Swift { class TLSLayerFactory; class ConnectionFactory; class ClientSession; class BasicSessionStream; + class Connector; class Client : public StanzaChannel, public IQRouter, public boost::bsignals::trackable { public: Client(const JID& jid, const String& password); ~Client(); @@ -43,27 +45,29 @@ namespace Swift { boost::signal<void (const ClientError&)> onError; boost::signal<void ()> onConnected; boost::signal<void (const String&)> onDataRead; boost::signal<void (const String&)> onDataWritten; private: - void handleConnectionConnectFinished(bool error); + void handleConnectorFinished(boost::shared_ptr<Connection>); void send(boost::shared_ptr<Stanza>); virtual String getNewIQID(); void handleElement(boost::shared_ptr<Element>); void handleSessionFinished(boost::shared_ptr<Error>); void handleNeedCredentials(); void handleDataRead(const String&); void handleDataWritten(const String&); void closeConnection(); private: + PlatformDomainNameResolver resolver_; JID jid_; String password_; IDGenerator idGenerator_; + boost::shared_ptr<Connector> connector_; ConnectionFactory* connectionFactory_; TLSLayerFactory* tlsLayerFactory_; FullPayloadParserFactoryCollection payloadParserFactories_; FullPayloadSerializerCollection payloadSerializers_; boost::shared_ptr<Connection> connection_; boost::shared_ptr<BasicSessionStream> sessionStream_; |
Swift