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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 RememberRemoteCandidate(new_remote_candidate, origin_port); | 731 RememberRemoteCandidate(new_remote_candidate, origin_port); |
732 | 732 |
733 return created; | 733 return created; |
734 } | 734 } |
735 | 735 |
736 // Setup a connection object for the local and remote candidate combination. | 736 // Setup a connection object for the local and remote candidate combination. |
737 // And then listen to connection object for changes. | 737 // And then listen to connection object for changes. |
738 bool P2PTransportChannel::CreateConnection(PortInterface* port, | 738 bool P2PTransportChannel::CreateConnection(PortInterface* port, |
739 const Candidate& remote_candidate, | 739 const Candidate& remote_candidate, |
740 PortInterface* origin_port) { | 740 PortInterface* origin_port) { |
| 741 if (!port->SupportsProtocol(remote_candidate.protocol())) { |
| 742 return false; |
| 743 } |
741 // Look for an existing connection with this remote address. If one is not | 744 // Look for an existing connection with this remote address. If one is not |
742 // found, then we can create a new connection for this address. | 745 // found, then we can create a new connection for this address. |
743 Connection* connection = port->GetConnection(remote_candidate.address()); | 746 Connection* connection = port->GetConnection(remote_candidate.address()); |
744 if (connection != NULL) { | 747 if (connection != NULL) { |
745 connection->MaybeUpdatePeerReflexiveCandidate(remote_candidate); | 748 connection->MaybeUpdatePeerReflexiveCandidate(remote_candidate); |
746 | 749 |
747 // It is not legal to try to change any of the parameters of an existing | 750 // It is not legal to try to change any of the parameters of an existing |
748 // connection; however, the other side can send a duplicate candidate. | 751 // connection; however, the other side can send a duplicate candidate. |
749 if (!remote_candidate.IsEquivalent(connection->remote_candidate())) { | 752 if (!remote_candidate.IsEquivalent(connection->remote_candidate())) { |
750 LOG(INFO) << "Attempt to change a remote candidate." | 753 LOG(INFO) << "Attempt to change a remote candidate." |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 SignalSentPacket(this, sent_packet); | 1397 SignalSentPacket(this, sent_packet); |
1395 } | 1398 } |
1396 | 1399 |
1397 void P2PTransportChannel::OnReadyToSend(Connection* connection) { | 1400 void P2PTransportChannel::OnReadyToSend(Connection* connection) { |
1398 if (connection == best_connection_ && writable()) { | 1401 if (connection == best_connection_ && writable()) { |
1399 SignalReadyToSend(this); | 1402 SignalReadyToSend(this); |
1400 } | 1403 } |
1401 } | 1404 } |
1402 | 1405 |
1403 } // namespace cricket | 1406 } // namespace cricket |
OLD | NEW |