diff options
Diffstat (limited to 'Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp')
-rw-r--r-- | Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp index c957481..df2a23d 100644 --- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp +++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp @@ -22,13 +22,13 @@ using namespace Swift; enum ExitCodes {OK = 0, CANNOT_CONNECT, CANNOT_AUTH, NO_RESPONSE, DISCO_ERROR}; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); -Client* client = 0; -JID recipient; -int exitCode = CANNOT_CONNECT; -boost::bsignals::connection errorConnection; +static Client* client = 0; +static JID recipient; +static int exitCode = CANNOT_CONNECT; +static boost::bsignals::connection errorConnection; -void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> /*info*/, ErrorPayload::ref error) { +static void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> /*info*/, ErrorPayload::ref error) { if (!error) { errorConnection.disconnect(); @@ -42,5 +42,5 @@ void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> /*info*/, ErrorP } -void handleConnected() { +static void handleConnected() { exitCode = NO_RESPONSE; GetDiscoInfoRequest::ref discoInfoRequest = GetDiscoInfoRequest::create(JID(), client->getIQRouter()); @@ -49,5 +49,5 @@ void handleConnected() { } -void handleDisconnected(const boost::optional<ClientError>&) { +static void handleDisconnected(const boost::optional<ClientError>&) { exitCode = CANNOT_AUTH; eventLoop.stop(); @@ -80,5 +80,7 @@ int main(int argc, char* argv[]) { if (!connectHost.empty()) { std::cout << connectHost << std::endl; - client->connect(connectHost); + ClientOptions options; + options.manualHostname = connectHost; + client->connect(options); } else { std::cout << " Default" << std::endl; |