summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-12-09 15:24:23 (GMT)
committerTobias Markmann <tm@ayena.de>2016-01-12 17:42:50 (GMT)
commit13801557b6664426cac26384441ab0b19ff9abb5 (patch)
tree924c5d47e157612e0492f29806910828fe38871f /Swiften/Network/BoostConnection.cpp
parente314293415c9691bb98188b514f6b13e33994d86 (diff)
downloadswift-13801557b6664426cac26384441ab0b19ff9abb5.zip
swift-13801557b6664426cac26384441ab0b19ff9abb5.tar.bz2
Listen to IPv6 any address instead of only IPv4
This should enable IPv4/IPv6 dual-stack support for Swift(-en) Jingle file-transfer support. Add Connection::getRemoteAddress() method. Test-Information: Tested IPv6 file-transfer and IPv4 file-transfer between two Swift instances. Added integration test verifying IPv4 only, IPv6 only and IPv4/IPv6 dual-stack support on the running platform. Additionally added test to verify remote addresses on dual-stack server. Change-Id: Ie384a71833eacca554f69e6f12a1c8330d0d747f
Diffstat (limited to 'Swiften/Network/BoostConnection.cpp')
-rw-r--r--Swiften/Network/BoostConnection.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/Swiften/Network/BoostConnection.cpp b/Swiften/Network/BoostConnection.cpp
index 6e90815..f495795 100644
--- a/Swiften/Network/BoostConnection.cpp
+++ b/Swiften/Network/BoostConnection.cpp
@@ -1,28 +1,29 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Network/BoostConnection.h>
+#include <algorithm>
#include <iostream>
#include <string>
-#include <algorithm>
-#include <boost/bind.hpp>
-#include <boost/thread.hpp>
+
#include <boost/asio/placeholders.hpp>
#include <boost/asio/write.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <boost/bind.hpp>
#include <boost/numeric/conversion/cast.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
+#include <boost/thread.hpp>
-#include <Swiften/Base/Log.h>
#include <Swiften/Base/Algorithm.h>
-#include <Swiften/EventLoop/EventLoop.h>
#include <Swiften/Base/ByteArray.h>
-#include <Swiften/Network/HostAddressPort.h>
-#include <Swiften/Base/sleep.h>
+#include <Swiften/Base/Log.h>
#include <Swiften/Base/SafeAllocator.h>
+#include <Swiften/Base/sleep.h>
+#include <Swiften/EventLoop/EventLoop.h>
+#include <Swiften/Network/HostAddressPort.h>
namespace Swift {
@@ -169,5 +170,9 @@ HostAddressPort BoostConnection::getLocalAddress() const {
return HostAddressPort(socket_.local_endpoint());
}
+HostAddressPort BoostConnection::getRemoteAddress() const {
+ return HostAddressPort(socket_.remote_endpoint());
+}
+
}