summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/Connector.h')
-rw-r--r--Swiften/Network/Connector.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h
index bf0efaf..16f8539 100644
--- a/Swiften/Network/Connector.h
+++ b/Swiften/Network/Connector.h
@@ -10,5 +10,6 @@
#include <Swiften/Base/boost_bsignals.h>
#include <boost/shared_ptr.hpp>
-
+#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Network/DomainNameServiceQuery.h>
#include <Swiften/Network/Connection.h>
@@ -24,10 +25,10 @@ namespace Swift {
class TimerFactory;
- class Connector : public boost::bsignals::trackable, public boost::enable_shared_from_this<Connector> {
+ class SWIFTEN_API Connector : public boost::bsignals::trackable, public boost::enable_shared_from_this<Connector> {
public:
typedef boost::shared_ptr<Connector> ref;
- static Connector::ref create(const std::string& hostname, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, int defaultPort = 5222) {
- return ref(new Connector(hostname, resolver, connectionFactory, timerFactory, defaultPort));
+ static Connector::ref create(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) {
+ return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory));
}
@@ -39,5 +40,5 @@ namespace Swift {
private:
- Connector(const std::string& hostname, DomainNameResolver*, ConnectionFactory*, TimerFactory*, int defaultPort);
+ Connector(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver*, ConnectionFactory*, TimerFactory*);
void handleServiceQueryResult(const std::vector<DomainNameServiceQuery::Result>& result);
@@ -56,8 +57,9 @@ namespace Swift {
private:
std::string hostname;
+ int port;
+ boost::optional<std::string> serviceLookupPrefix;
DomainNameResolver* resolver;
ConnectionFactory* connectionFactory;
TimerFactory* timerFactory;
- int defaultPort;
int timeoutMilliseconds;
boost::shared_ptr<Timer> timer;
@@ -70,3 +72,3 @@ namespace Swift {
bool foundSomeDNS;
};
-};
+}