OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |