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

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

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments and add tests Created 5 years, 5 months 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 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 virtual int SendPacket(const char *data, size_t len, 78 virtual int SendPacket(const char *data, size_t len,
79 const rtc::PacketOptions& options, int flags); 79 const rtc::PacketOptions& options, int flags);
80 virtual int SetOption(rtc::Socket::Option opt, int value); 80 virtual int SetOption(rtc::Socket::Option opt, int value);
81 virtual bool GetOption(rtc::Socket::Option opt, int* value); 81 virtual bool GetOption(rtc::Socket::Option opt, int* value);
82 virtual int GetError() { return error_; } 82 virtual int GetError() { return error_; }
83 virtual bool GetStats(std::vector<ConnectionInfo>* stats); 83 virtual bool GetStats(std::vector<ConnectionInfo>* stats);
84 84
85 const Connection* best_connection() const { return best_connection_; } 85 const Connection* best_connection() const { return best_connection_; }
86 void set_incoming_only(bool value) { incoming_only_ = value; } 86 void set_incoming_only(bool value) { incoming_only_ = value; }
87 87
88 // Sets the receiving timeout in milliseconds.
89 // This also sets the check_receiving_delay proportionally.
90 void set_receiving_timeout(int receiving_timeout_ms);
91
88 // Note: This is only for testing purpose. 92 // Note: This is only for testing purpose.
89 // |ports_| should not be changed from outside. 93 // |ports_| should not be changed from outside.
90 const std::vector<PortInterface*>& ports() { return ports_; } 94 const std::vector<PortInterface*>& ports() { return ports_; }
91 95
92 IceMode remote_ice_mode() const { return remote_ice_mode_; } 96 IceMode remote_ice_mode() const { return remote_ice_mode_; }
93 97
94 // DTLS methods. 98 // DTLS methods.
95 virtual bool IsDtlsActive() const { return false; } 99 virtual bool IsDtlsActive() const { return false; }
96 100
97 // Default implementation. 101 // Default implementation.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 const rtc::PacketTime& packet_time); 210 const rtc::PacketTime& packet_time);
207 void OnReadyToSend(Connection* connection); 211 void OnReadyToSend(Connection* connection);
208 void OnConnectionDestroyed(Connection *connection); 212 void OnConnectionDestroyed(Connection *connection);
209 213
210 void OnUseCandidate(Connection* conn); 214 void OnUseCandidate(Connection* conn);
211 215
212 virtual void OnMessage(rtc::Message *pmsg); 216 virtual void OnMessage(rtc::Message *pmsg);
213 void OnSort(); 217 void OnSort();
214 void OnPing(); 218 void OnPing();
215 219
220 void OnCheckReceiving();
221
216 P2PTransport* transport_; 222 P2PTransport* transport_;
217 PortAllocator *allocator_; 223 PortAllocator *allocator_;
218 rtc::Thread *worker_thread_; 224 rtc::Thread *worker_thread_;
219 bool incoming_only_; 225 bool incoming_only_;
220 bool waiting_for_signaling_; 226 bool waiting_for_signaling_;
221 int error_; 227 int error_;
222 std::vector<PortAllocatorSession*> allocator_sessions_; 228 std::vector<PortAllocatorSession*> allocator_sessions_;
223 std::vector<PortInterface *> ports_; 229 std::vector<PortInterface *> ports_;
224 std::vector<Connection *> connections_; 230 std::vector<Connection *> connections_;
225 Connection* best_connection_; 231 Connection* best_connection_;
226 // Connection selected by the controlling agent. This should be used only 232 // Connection selected by the controlling agent. This should be used only
227 // at controlled side when protocol type is RFC5245. 233 // at controlled side when protocol type is RFC5245.
228 Connection* pending_best_connection_; 234 Connection* pending_best_connection_;
229 std::vector<RemoteCandidate> remote_candidates_; 235 std::vector<RemoteCandidate> remote_candidates_;
230 bool sort_dirty_; // indicates whether another sort is needed right now 236 bool sort_dirty_; // indicates whether another sort is needed right now
231 bool was_writable_; 237 bool was_writable_;
232 typedef std::map<rtc::Socket::Option, int> OptionMap; 238 typedef std::map<rtc::Socket::Option, int> OptionMap;
233 OptionMap options_; 239 OptionMap options_;
234 std::string ice_ufrag_; 240 std::string ice_ufrag_;
235 std::string ice_pwd_; 241 std::string ice_pwd_;
236 std::string remote_ice_ufrag_; 242 std::string remote_ice_ufrag_;
237 std::string remote_ice_pwd_; 243 std::string remote_ice_pwd_;
238 IceProtocolType protocol_type_; 244 IceProtocolType protocol_type_;
239 IceMode remote_ice_mode_; 245 IceMode remote_ice_mode_;
240 IceRole ice_role_; 246 IceRole ice_role_;
241 uint64 tiebreaker_; 247 uint64 tiebreaker_;
242 uint32 remote_candidate_generation_; 248 uint32 remote_candidate_generation_;
243 249
250 int check_receiving_delay_;
251 int receiving_timeout_;
252
244 DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 253 DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
245 }; 254 };
246 255
247 } // namespace cricket 256 } // namespace cricket
248 257
249 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 258 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698