Chromium Code Reviews| Index: webrtc/base/physicalsocketserver.cc |
| diff --git a/webrtc/base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc |
| index 3e454527ca80f3e86282d129cdb403fc5b5c5370..10c631074973d8e4342adf6bf73f161ed52a701f 100644 |
| --- a/webrtc/base/physicalsocketserver.cc |
| +++ b/webrtc/base/physicalsocketserver.cc |
| @@ -7,6 +7,7 @@ |
| * in the file PATENTS. All contributing project authors may |
| * be found in the AUTHORS file in the root of the source tree. |
| */ |
| +#include "webrtc/base/physicalsocketserver.h" |
| #if defined(_MSC_VER) && _MSC_VER < 1300 |
| #pragma warning(disable:4786) |
| @@ -44,7 +45,6 @@ |
| #include "webrtc/base/byteorder.h" |
| #include "webrtc/base/common.h" |
| #include "webrtc/base/logging.h" |
| -#include "webrtc/base/physicalsocketserver.h" |
| #include "webrtc/base/timeutils.h" |
| #include "webrtc/base/winping.h" |
| #include "webrtc/base/win32socketinit.h" |
| @@ -174,6 +174,14 @@ int PhysicalSocket::Bind(const SocketAddress& bind_addr) { |
| dbg_addr_.append(GetLocalAddress().ToString()); |
| } |
| #endif |
| + if (ss_->network_binder()) { |
| + int result = |
| + ss_->network_binder()->BindSocketToNetwork(s_, bind_addr.ipaddr()); |
| + if (result < 0) { |
| + LOG(LS_INFO) << "Binding socket to network address " |
| + << bind_addr.ipaddr().ToString() << " result " << result; |
| + } |
| + } |
| return err; |
| } |
| @@ -1109,7 +1117,7 @@ private: |
| PhysicalSocketServer* ss_; |
| WSAEVENT hev_; |
| }; |
| -#endif // WEBRTC_WIN |
| +#endif // WEBRTC_WIN |
| // Sets the value of a boolean value to false when signaled. |
| class Signaler : public EventDispatcher { |
| @@ -1151,6 +1159,13 @@ void PhysicalSocketServer::WakeUp() { |
| signal_wakeup_->Signal(); |
| } |
| +void PhysicalSocketServer::MaybeSetNetworkBinder() { |
| + if (NetworkMonitorFactory::GetFactory()) { |
| + network_binder_ = |
| + NetworkMonitorFactory::GetFactory()->GetOrCreateNetworkMonitor(); |
| + } |
|
pthatcher1
2016/01/14 20:07:24
I'm not sure if this is the best way to get it con
honghaiz3
2016/01/15 01:00:38
Removed this. Set Networkbinder from the network m
|
| +} |
| + |
| Socket* PhysicalSocketServer::CreateSocket(int type) { |
| return CreateSocket(AF_INET, type); |
| } |
| @@ -1603,6 +1618,6 @@ bool PhysicalSocketServer::Wait(int cmsWait, bool process_io) { |
| // Done |
| return true; |
| } |
| -#endif // WEBRTC_WIN |
| +#endif // WEBRTC_WIN |
| } // namespace rtc |