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

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

Issue 2171183002: Remove ports that are not used by any channel after timeout (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « webrtc/p2p/base/fakeportallocator.h ('k') | webrtc/p2p/base/p2ptransportchannel.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 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 int GetError() override { return error_; } 120 int GetError() override { return error_; }
121 bool GetStats(std::vector<ConnectionInfo>* stats) override; 121 bool GetStats(std::vector<ConnectionInfo>* stats) override;
122 122
123 // TODO(honghaiz): Remove this method once the reference of it in 123 // TODO(honghaiz): Remove this method once the reference of it in
124 // Chromoting is removed. 124 // Chromoting is removed.
125 const Connection* best_connection() const { return selected_connection_; } 125 const Connection* best_connection() const { return selected_connection_; }
126 126
127 const Connection* selected_connection() const { return selected_connection_; } 127 const Connection* selected_connection() const { return selected_connection_; }
128 void set_incoming_only(bool value) { incoming_only_ = value; } 128 void set_incoming_only(bool value) { incoming_only_ = value; }
129 129
130 // Note: This is only for testing purpose. 130 // Note: These are only for testing purpose.
131 // |ports_| should not be changed from outside. 131 // |ports_| and |pruned_ports| should not be changed from outside.
132 const std::vector<PortInterface*>& ports() { return ports_; } 132 const std::vector<PortInterface*>& ports() { return ports_; }
133 const std::vector<PortInterface*>& pruned_ports() { return pruned_ports_; }
133 134
134 IceMode remote_ice_mode() const { return remote_ice_mode_; } 135 IceMode remote_ice_mode() const { return remote_ice_mode_; }
135 136
136 // DTLS methods. 137 // DTLS methods.
137 bool IsDtlsActive() const override { return false; } 138 bool IsDtlsActive() const override { return false; }
138 139
139 // Default implementation. 140 // Default implementation.
140 bool GetSslRole(rtc::SSLRole* role) const override { return false; } 141 bool GetSslRole(rtc::SSLRole* role) const override { return false; }
141 142
142 bool SetSslRole(rtc::SSLRole role) override { return false; } 143 bool SetSslRole(rtc::SSLRole role) override { return false; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return false; 178 return false;
178 } 179 }
179 180
180 // Set DTLS Remote fingerprint. Must be after local identity set. 181 // Set DTLS Remote fingerprint. Must be after local identity set.
181 bool SetRemoteFingerprint(const std::string& digest_alg, 182 bool SetRemoteFingerprint(const std::string& digest_alg,
182 const uint8_t* digest, 183 const uint8_t* digest,
183 size_t digest_len) override { 184 size_t digest_len) override {
184 return false; 185 return false;
185 } 186 }
186 187
188 void PruneAllPorts();
187 int receiving_timeout() const { return config_.receiving_timeout; } 189 int receiving_timeout() const { return config_.receiving_timeout; }
188 int check_receiving_interval() const { return check_receiving_interval_; } 190 int check_receiving_interval() const { return check_receiving_interval_; }
189 191
190 // Helper method used only in unittest. 192 // Helper method used only in unittest.
191 rtc::DiffServCodePoint DefaultDscpValue() const; 193 rtc::DiffServCodePoint DefaultDscpValue() const;
192 194
193 // Public for unit tests. 195 // Public for unit tests.
194 Connection* FindNextPingableConnection(); 196 Connection* FindNextPingableConnection();
195 void MarkConnectionPinged(Connection* conn); 197 void MarkConnectionPinged(Connection* conn);
196 198
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 ProtocolType proto, 290 ProtocolType proto,
289 IceMessage* stun_msg, 291 IceMessage* stun_msg,
290 const std::string& remote_username, 292 const std::string& remote_username,
291 bool port_muxed); 293 bool port_muxed);
292 294
293 // When a port is destroyed, remove it from both lists |ports_| 295 // When a port is destroyed, remove it from both lists |ports_|
294 // and |pruned_ports_|. 296 // and |pruned_ports_|.
295 void OnPortDestroyed(PortInterface* port); 297 void OnPortDestroyed(PortInterface* port);
296 // When pruning a port, move it from |ports_| to |pruned_ports_|. 298 // When pruning a port, move it from |ports_| to |pruned_ports_|.
297 // Returns true if the port is found and removed from |ports_|. 299 // Returns true if the port is found and removed from |ports_|.
298 bool OnPortPruned(PortInterface* port); 300 bool PrunePort(PortInterface* port);
299 void OnRoleConflict(PortInterface* port); 301 void OnRoleConflict(PortInterface* port);
300 302
301 void OnConnectionStateChange(Connection* connection); 303 void OnConnectionStateChange(Connection* connection);
302 void OnReadPacket(Connection *connection, const char *data, size_t len, 304 void OnReadPacket(Connection *connection, const char *data, size_t len,
303 const rtc::PacketTime& packet_time); 305 const rtc::PacketTime& packet_time);
304 void OnSentPacket(const rtc::SentPacket& sent_packet); 306 void OnSentPacket(const rtc::SentPacket& sent_packet);
305 void OnReadyToSend(Connection* connection); 307 void OnReadyToSend(Connection* connection);
306 void OnConnectionDestroyed(Connection *connection); 308 void OnConnectionDestroyed(Connection *connection);
307 309
308 void OnNominated(Connection* conn); 310 void OnNominated(Connection* conn);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 IceConfig config_; 402 IceConfig config_;
401 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. 403 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before.
402 bool started_pinging_ = false; 404 bool started_pinging_ = false;
403 405
404 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 406 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
405 }; 407 };
406 408
407 } // namespace cricket 409 } // namespace cricket
408 410
409 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 411 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/fakeportallocator.h ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698