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

Side by Side Diff: webrtc/p2p/base/turnport.h

Issue 1516613002: Only try to pair protocol matching candidates for creating connections. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: merge Created 5 years 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/tcpport.cc ('k') | webrtc/p2p/base/turnport.cc » ('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 2012 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2012 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const rtc::PacketTime& packet_time) { 100 const rtc::PacketTime& packet_time) {
101 OnReadPacket(socket, data, size, remote_addr, packet_time); 101 OnReadPacket(socket, data, size, remote_addr, packet_time);
102 return true; 102 return true;
103 } 103 }
104 virtual void OnReadPacket(rtc::AsyncPacketSocket* socket, 104 virtual void OnReadPacket(rtc::AsyncPacketSocket* socket,
105 const char* data, size_t size, 105 const char* data, size_t size,
106 const rtc::SocketAddress& remote_addr, 106 const rtc::SocketAddress& remote_addr,
107 const rtc::PacketTime& packet_time); 107 const rtc::PacketTime& packet_time);
108 108
109 virtual void OnReadyToSend(rtc::AsyncPacketSocket* socket); 109 virtual void OnReadyToSend(rtc::AsyncPacketSocket* socket);
110 virtual bool SupportsProtocol(const std::string& protocol) const {
111 // Turn port only connects to UDP candidates.
112 return protocol == UDP_PROTOCOL_NAME;
113 }
110 114
111 void OnSocketConnect(rtc::AsyncPacketSocket* socket); 115 void OnSocketConnect(rtc::AsyncPacketSocket* socket);
112 void OnSocketClose(rtc::AsyncPacketSocket* socket, int error); 116 void OnSocketClose(rtc::AsyncPacketSocket* socket, int error);
113 117
114 118
115 const std::string& hash() const { return hash_; } 119 const std::string& hash() const { return hash_; }
116 const std::string& nonce() const { return nonce_; } 120 const std::string& nonce() const { return nonce_; }
117 121
118 int error() const { return error_; } 122 int error() const { return error_; }
119 123
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 friend class TurnEntry; 276 friend class TurnEntry;
273 friend class TurnAllocateRequest; 277 friend class TurnAllocateRequest;
274 friend class TurnRefreshRequest; 278 friend class TurnRefreshRequest;
275 friend class TurnCreatePermissionRequest; 279 friend class TurnCreatePermissionRequest;
276 friend class TurnChannelBindRequest; 280 friend class TurnChannelBindRequest;
277 }; 281 };
278 282
279 } // namespace cricket 283 } // namespace cricket
280 284
281 #endif // WEBRTC_P2P_BASE_TURNPORT_H_ 285 #endif // WEBRTC_P2P_BASE_TURNPORT_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/tcpport.cc ('k') | webrtc/p2p/base/turnport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698