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

Side by Side Diff: webrtc/base/virtualsocketserver.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // process the local address. (i.e. SetAlternativeLocalAddress). 157 // process the local address. (i.e. SetAlternativeLocalAddress).
158 server_->msg_queue_->Post(this, MSG_ID_ADDRESS_BOUND); 158 server_->msg_queue_->Post(this, MSG_ID_ADDRESS_BOUND);
159 } 159 }
160 return result; 160 return result;
161 } 161 }
162 162
163 int VirtualSocket::Connect(const SocketAddress& addr) { 163 int VirtualSocket::Connect(const SocketAddress& addr) {
164 return InitiateConnect(addr, true); 164 return InitiateConnect(addr, true);
165 } 165 }
166 166
167 int VirtualSocket::BindToNetwork(NetworkHandle handle) {
168 return 0;
169 }
170
167 int VirtualSocket::Close() { 171 int VirtualSocket::Close() {
168 if (!local_addr_.IsNil() && bound_) { 172 if (!local_addr_.IsNil() && bound_) {
169 // Remove from the binding table. 173 // Remove from the binding table.
170 server_->Unbind(local_addr_, this); 174 server_->Unbind(local_addr_, this);
171 bound_ = false; 175 bound_ = false;
172 } 176 }
173 177
174 if (SOCK_STREAM == type_) { 178 if (SOCK_STREAM == type_) {
175 // Cancel pending sockets 179 // Cancel pending sockets
176 if (listen_queue_) { 180 if (listen_queue_) {
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) { 1126 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) {
1123 RTC_DCHECK(!IPIsAny(from_addr)); 1127 RTC_DCHECK(!IPIsAny(from_addr));
1124 if (from_addr.family() == AF_INET) { 1128 if (from_addr.family() == AF_INET) {
1125 default_route_v4_ = from_addr; 1129 default_route_v4_ = from_addr;
1126 } else if (from_addr.family() == AF_INET6) { 1130 } else if (from_addr.family() == AF_INET6) {
1127 default_route_v6_ = from_addr; 1131 default_route_v6_ = from_addr;
1128 } 1132 }
1129 } 1133 }
1130 1134
1131 } // namespace rtc 1135 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698