OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
7 // | 7 // |
8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
10 // | 10 // |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 size_t NumQueuedPackets() const { return queued_packets_.size(); } | 334 size_t NumQueuedPackets() const { return queued_packets_.size(); } |
335 | 335 |
336 QuicEncryptedPacket* ReleaseConnectionClosePacket() { | 336 QuicEncryptedPacket* ReleaseConnectionClosePacket() { |
337 return connection_close_packet_.release(); | 337 return connection_close_packet_.release(); |
338 } | 338 } |
339 | 339 |
340 // Flush any queued frames immediately. Preserves the batch write mode and | 340 // Flush any queued frames immediately. Preserves the batch write mode and |
341 // does nothing if there are no pending frames. | 341 // does nothing if there are no pending frames. |
342 void Flush(); | 342 void Flush(); |
343 | 343 |
| 344 // Returns true if the underlying UDP socket is writable, there is |
| 345 // no queued data and the connection is not congestion-control |
| 346 // blocked. |
| 347 bool CanWriteStreamData(); |
| 348 |
344 // Returns true if the connection has queued packets or frames. | 349 // Returns true if the connection has queued packets or frames. |
345 bool HasQueuedData() const; | 350 bool HasQueuedData() const; |
346 | 351 |
347 // Sets (or resets) the idle state connection timeout. Also, checks and times | 352 // Sets (or resets) the idle state connection timeout. Also, checks and times |
348 // out the connection if network timer has expired for |timeout|. | 353 // out the connection if network timer has expired for |timeout|. |
349 void SetIdleNetworkTimeout(QuicTime::Delta timeout); | 354 void SetIdleNetworkTimeout(QuicTime::Delta timeout); |
350 // Sets (or resets) the total time delta the connection can be alive for. | 355 // Sets (or resets) the total time delta the connection can be alive for. |
351 // Also, checks and times out the connection if timer has expired for | 356 // Also, checks and times out the connection if timer has expired for |
352 // |timeout|. Used to limit the time a connection can be alive before crypto | 357 // |timeout|. Used to limit the time a connection can be alive before crypto |
353 // handshake finishes. | 358 // handshake finishes. |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 // If non-empty this contains the set of versions received in a | 718 // If non-empty this contains the set of versions received in a |
714 // version negotiation packet. | 719 // version negotiation packet. |
715 QuicVersionVector server_supported_versions_; | 720 QuicVersionVector server_supported_versions_; |
716 | 721 |
717 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 722 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
718 }; | 723 }; |
719 | 724 |
720 } // namespace net | 725 } // namespace net |
721 | 726 |
722 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 727 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |