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

Unified Diff: webrtc/base/physicalsocketserver.cc

Issue 1556743002: Bind a socket to a network if the network handle is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months 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/base/networkmonitor.cc ('k') | webrtc/base/socketserver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/physicalsocketserver.cc
diff --git a/webrtc/base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc
index 3e454527ca80f3e86282d129cdb403fc5b5c5370..67fbea0a2fc60bacd5b2711b62e0947888ca30cc 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,7 @@
#include "webrtc/base/byteorder.h"
#include "webrtc/base/common.h"
#include "webrtc/base/logging.h"
-#include "webrtc/base/physicalsocketserver.h"
+#include "webrtc/base/networkmonitor.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/base/winping.h"
#include "webrtc/base/win32socketinit.h"
@@ -174,6 +175,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 +1118,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 {
@@ -1603,6 +1612,6 @@ bool PhysicalSocketServer::Wait(int cmsWait, bool process_io) {
// Done
return true;
}
-#endif // WEBRTC_WIN
+#endif // WEBRTC_WIN
} // namespace rtc
« no previous file with comments | « webrtc/base/networkmonitor.cc ('k') | webrtc/base/socketserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698