diff options
Diffstat (limited to 'Swiften/Examples/NetworkTool/main.cpp')
-rw-r--r-- | Swiften/Examples/NetworkTool/main.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Examples/NetworkTool/main.cpp b/Swiften/Examples/NetworkTool/main.cpp index 00c12d2..10a0aa6 100644 --- a/Swiften/Examples/NetworkTool/main.cpp +++ b/Swiften/Examples/NetworkTool/main.cpp @@ -16,9 +16,9 @@ using namespace Swift; -SimpleEventLoop eventLoop; +static SimpleEventLoop eventLoop; -void handleGetPublicIPRequestResponse(const boost::optional<HostAddress>& result) { +static void handleGetPublicIPRequestResponse(const boost::optional<HostAddress>& result) { if (result) { std::cerr << "Result: " << result->toString() << std::endl;; } @@ -28,7 +28,7 @@ void handleGetPublicIPRequestResponse(const boost::optional<HostAddress>& result eventLoop.stop(); } -void handleGetForwardPortRequestResponse(const boost::optional<NATPortMapping>& result) { +static void handleGetForwardPortRequestResponse(const boost::optional<NATPortMapping>& result) { if (result) { std::cerr << "Result: " << result->getPublicPort() << " -> " << result->getLocalPort() << std::endl;; } @@ -38,7 +38,7 @@ void handleGetForwardPortRequestResponse(const boost::optional<NATPortMapping>& eventLoop.stop(); } -void handleRemovePortForwardingRequestResponse(bool result) { +static void handleRemovePortForwardingRequestResponse(bool result) { if (result) { std::cerr << "Result: OK" << std::endl; } @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) { if (std::string(argv[1]) == "get-public-ip") { boost::shared_ptr<NATTraversalGetPublicIPRequest> query = natTraverser.createGetPublicIPRequest(); query->onResult.connect(boost::bind(&handleGetPublicIPRequestResponse, _1)); - query->run(); + query->start(); eventLoop.run(); } else if (std::string(argv[1]) == "add-port-forward") { @@ -67,7 +67,7 @@ int main(int argc, char* argv[]) { } boost::shared_ptr<NATTraversalForwardPortRequest> query = natTraverser.createForwardPortRequest(boost::lexical_cast<int>(argv[2]), boost::lexical_cast<int>(argv[3])); query->onResult.connect(boost::bind(&handleGetForwardPortRequestResponse, _1)); - query->run(); + query->start(); eventLoop.run(); } else if (std::string(argv[1]) == "remove-port-forward") { @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) { } boost::shared_ptr<NATTraversalRemovePortForwardingRequest> query = natTraverser.createRemovePortForwardingRequest(boost::lexical_cast<int>(argv[2]), boost::lexical_cast<int>(argv[3])); query->onResult.connect(boost::bind(&handleRemovePortForwardingRequestResponse, _1)); - query->run(); + query->start(); eventLoop.run(); } else if (std::string(argv[1]) == "get-local-ip") { |