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

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: 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
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 ProtocolMatch(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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 friend class TurnEntry; 262 friend class TurnEntry;
259 friend class TurnAllocateRequest; 263 friend class TurnAllocateRequest;
260 friend class TurnRefreshRequest; 264 friend class TurnRefreshRequest;
261 friend class TurnCreatePermissionRequest; 265 friend class TurnCreatePermissionRequest;
262 friend class TurnChannelBindRequest; 266 friend class TurnChannelBindRequest;
263 }; 267 };
264 268
265 } // namespace cricket 269 } // namespace cricket
266 270
267 #endif // WEBRTC_P2P_BASE_TURNPORT_H_ 271 #endif // WEBRTC_P2P_BASE_TURNPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698