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

Side by Side Diff: webrtc/p2p/base/tcpport.cc

Issue 2018693002: Create a new connection if a candidate reuses an address (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: address comments Created 4 years, 6 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
« no previous file with comments | « webrtc/p2p/base/stunport.cc ('k') | webrtc/p2p/base/turnport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 TCPConnection* conn = NULL; 157 TCPConnection* conn = NULL;
158 if (rtc::AsyncPacketSocket* socket = 158 if (rtc::AsyncPacketSocket* socket =
159 GetIncoming(address.address(), true)) { 159 GetIncoming(address.address(), true)) {
160 socket->SignalReadPacket.disconnect(this); 160 socket->SignalReadPacket.disconnect(this);
161 conn = new TCPConnection(this, address, socket); 161 conn = new TCPConnection(this, address, socket);
162 } else { 162 } else {
163 conn = new TCPConnection(this, address); 163 conn = new TCPConnection(this, address);
164 } 164 }
165 AddConnection(conn); 165 AddOrReplaceConnection(conn);
166 return conn; 166 return conn;
167 } 167 }
168 168
169 void TCPPort::PrepareAddress() { 169 void TCPPort::PrepareAddress() {
170 if (socket_) { 170 if (socket_) {
171 // If socket isn't bound yet the address will be added in 171 // If socket isn't bound yet the address will be added in
172 // OnAddressReady(). Socket may be in the CLOSED state if Listen() 172 // OnAddressReady(). Socket may be in the CLOSED state if Listen()
173 // failed, we still want to add the socket address. 173 // failed, we still want to add the socket address.
174 LOG(LS_VERBOSE) << "Preparing TCP address, current state: " 174 LOG(LS_VERBOSE) << "Preparing TCP address, current state: "
175 << socket_->GetState(); 175 << socket_->GetState();
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 void TCPConnection::ConnectSocketSignals(rtc::AsyncPacketSocket* socket) { 512 void TCPConnection::ConnectSocketSignals(rtc::AsyncPacketSocket* socket) {
513 if (outgoing_) { 513 if (outgoing_) {
514 socket->SignalConnect.connect(this, &TCPConnection::OnConnect); 514 socket->SignalConnect.connect(this, &TCPConnection::OnConnect);
515 } 515 }
516 socket->SignalReadPacket.connect(this, &TCPConnection::OnReadPacket); 516 socket->SignalReadPacket.connect(this, &TCPConnection::OnReadPacket);
517 socket->SignalReadyToSend.connect(this, &TCPConnection::OnReadyToSend); 517 socket->SignalReadyToSend.connect(this, &TCPConnection::OnReadyToSend);
518 socket->SignalClose.connect(this, &TCPConnection::OnClose); 518 socket->SignalClose.connect(this, &TCPConnection::OnClose);
519 } 519 }
520 520
521 } // namespace cricket 521 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/stunport.cc ('k') | webrtc/p2p/base/turnport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698