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 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 local_candidate().address())); | 1389 local_candidate().address())); |
1390 | 1390 |
1391 // Change the local candidate of this Connection to the new prflx candidate. | 1391 // Change the local candidate of this Connection to the new prflx candidate. |
1392 local_candidate_index_ = port_->AddPrflxCandidate(new_local_candidate); | 1392 local_candidate_index_ = port_->AddPrflxCandidate(new_local_candidate); |
1393 | 1393 |
1394 // SignalStateChange to force a re-sort in P2PTransportChannel as this | 1394 // SignalStateChange to force a re-sort in P2PTransportChannel as this |
1395 // Connection's local candidate has changed. | 1395 // Connection's local candidate has changed. |
1396 SignalStateChange(this); | 1396 SignalStateChange(this); |
1397 } | 1397 } |
1398 | 1398 |
1399 ProxyConnection::ProxyConnection(Port* port, size_t index, | 1399 ProxyConnection::ProxyConnection(Port* port, |
1400 const Candidate& candidate) | 1400 size_t index, |
1401 : Connection(port, index, candidate), error_(0) { | 1401 const Candidate& remote_candidate) |
1402 } | 1402 : Connection(port, index, remote_candidate) {} |
1403 | 1403 |
1404 int ProxyConnection::Send(const void* data, size_t size, | 1404 int ProxyConnection::Send(const void* data, size_t size, |
1405 const rtc::PacketOptions& options) { | 1405 const rtc::PacketOptions& options) { |
1406 if (write_state_ == STATE_WRITE_INIT || write_state_ == STATE_WRITE_TIMEOUT) { | 1406 if (write_state_ == STATE_WRITE_INIT || write_state_ == STATE_WRITE_TIMEOUT) { |
1407 error_ = EWOULDBLOCK; | 1407 error_ = EWOULDBLOCK; |
1408 return SOCKET_ERROR; | 1408 return SOCKET_ERROR; |
1409 } | 1409 } |
1410 sent_packets_total_++; | 1410 sent_packets_total_++; |
1411 int sent = port_->SendTo(data, size, remote_candidate_.address(), | 1411 int sent = port_->SendTo(data, size, remote_candidate_.address(), |
1412 options, true); | 1412 options, true); |
1413 if (sent <= 0) { | 1413 if (sent <= 0) { |
1414 ASSERT(sent < 0); | 1414 ASSERT(sent < 0); |
1415 error_ = port_->GetError(); | 1415 error_ = port_->GetError(); |
1416 sent_packets_discarded_++; | 1416 sent_packets_discarded_++; |
1417 } else { | 1417 } else { |
1418 send_rate_tracker_.AddSamples(sent); | 1418 send_rate_tracker_.AddSamples(sent); |
1419 } | 1419 } |
1420 return sent; | 1420 return sent; |
1421 } | 1421 } |
1422 | 1422 |
1423 } // namespace cricket | 1423 } // namespace cricket |
OLD | NEW |