Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: webrtc/p2p/base/basicpacketsocketfactory.cc

Issue 1535943004: Multi-networking with Android L. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/basicpacketsocketfactory.h ('k') | webrtc/p2p/base/packetsocketfactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/basicpacketsocketfactory.cc
diff --git a/webrtc/p2p/base/basicpacketsocketfactory.cc b/webrtc/p2p/base/basicpacketsocketfactory.cc
index 697518da9d0508cfcec888306b133514307726c7..ba87473b9cb03c4daf7d2d1168e9c116985a2a45 100644
--- a/webrtc/p2p/base/basicpacketsocketfactory.cc
+++ b/webrtc/p2p/base/basicpacketsocketfactory.cc
@@ -21,6 +21,7 @@
#include "webrtc/base/socketadapters.h"
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/thread.h"
+#include "webrtc/base/network.h"
namespace rtc {
@@ -47,6 +48,14 @@ AsyncPacketSocket* BasicPacketSocketFactory::CreateUdpSocket(
const SocketAddress& address,
uint16_t min_port,
uint16_t max_port) {
+ return CreateUdpSocket(address, min_port, max_port, nullptr);
+}
+
+AsyncPacketSocket* BasicPacketSocketFactory::CreateUdpSocket(
+ const SocketAddress& address,
+ uint16_t min_port,
+ uint16_t max_port,
+ const Network* network) {
// UDP sockets are simple.
rtc::AsyncSocket* socket =
socket_factory()->CreateAsyncSocket(
@@ -54,6 +63,11 @@ AsyncPacketSocket* BasicPacketSocketFactory::CreateUdpSocket(
if (!socket) {
return NULL;
}
+ if (network != nullptr && network->handle()) {
+ LOG(LS_INFO) << "Bind network handle XXX "<< network->handle();
+ int res = socket->BindToNetwork(network->handle());
+ LOG(LS_INFO) << "Bind network handle XXX "<< network->handle() <<" result "<< res;
+ }
if (BindSocket(socket, address, min_port, max_port) < 0) {
LOG(LS_ERROR) << "UDP bind failed with error "
<< socket->GetError();
« no previous file with comments | « webrtc/p2p/base/basicpacketsocketfactory.h ('k') | webrtc/p2p/base/packetsocketfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698