| 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 // A QuicSession, which demuxes a single connection to individual streams. | 5 // A QuicSession, which demuxes a single connection to individual streams. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_QUIC_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SESSION_H_ |
| 8 #define NET_QUIC_QUIC_SESSION_H_ | 8 #define NET_QUIC_QUIC_SESSION_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // Called on every incoming packet. Passes |packet| through to |connection_|. | 88 // Called on every incoming packet. Passes |packet| through to |connection_|. |
| 89 virtual void ProcessUdpPacket(const IPEndPoint& self_address, | 89 virtual void ProcessUdpPacket(const IPEndPoint& self_address, |
| 90 const IPEndPoint& peer_address, | 90 const IPEndPoint& peer_address, |
| 91 const QuicEncryptedPacket& packet); | 91 const QuicEncryptedPacket& packet); |
| 92 | 92 |
| 93 // Called by streams when they want to write data to the peer. | 93 // Called by streams when they want to write data to the peer. |
| 94 // Returns a pair with the number of bytes consumed from data, and a boolean | 94 // Returns a pair with the number of bytes consumed from data, and a boolean |
| 95 // indicating if the fin bit was consumed. This does not indicate the data | 95 // indicating if the fin bit was consumed. This does not indicate the data |
| 96 // has been sent on the wire: it may have been turned into a packet and queued | 96 // has been sent on the wire: it may have been turned into a packet and queued |
| 97 // if the socket was unexpectedly blocked. |fec_protection| indicates if | 97 // if the socket was unexpectedly blocked. |
| 98 // data is to be FEC protected. Note that data that is sent immediately | |
| 99 // following MUST_FEC_PROTECT data may get protected by falling within the | |
| 100 // same FEC group. | |
| 101 // If provided, |ack_notifier_delegate| will be registered to be notified when | 98 // If provided, |ack_notifier_delegate| will be registered to be notified when |
| 102 // we have seen ACKs for all packets resulting from this call. | 99 // we have seen ACKs for all packets resulting from this call. |
| 103 virtual QuicConsumedData WritevData( | 100 virtual QuicConsumedData WritevData( |
| 104 QuicStreamId id, | 101 QuicStreamId id, |
| 105 QuicIOVector iov, | 102 QuicIOVector iov, |
| 106 QuicStreamOffset offset, | 103 QuicStreamOffset offset, |
| 107 bool fin, | 104 bool fin, |
| 108 FecProtection fec_protection, | |
| 109 QuicAckListenerInterface* ack_notifier_delegate); | 105 QuicAckListenerInterface* ack_notifier_delegate); |
| 110 | 106 |
| 111 // Called by streams when they want to close the stream in both directions. | 107 // Called by streams when they want to close the stream in both directions. |
| 112 virtual void SendRstStream(QuicStreamId id, | 108 virtual void SendRstStream(QuicStreamId id, |
| 113 QuicRstStreamErrorCode error, | 109 QuicRstStreamErrorCode error, |
| 114 QuicStreamOffset bytes_written); | 110 QuicStreamOffset bytes_written); |
| 115 | 111 |
| 116 // Called when the session wants to go away and not accept any new streams. | 112 // Called when the session wants to go away and not accept any new streams. |
| 117 void SendGoAway(QuicErrorCode error_code, const std::string& reason); | 113 void SendGoAway(QuicErrorCode error_code, const std::string& reason); |
| 118 | 114 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 // The stream id which was last popped in OnCanWrite, or 0, if not under the | 403 // The stream id which was last popped in OnCanWrite, or 0, if not under the |
| 408 // call stack of OnCanWrite. | 404 // call stack of OnCanWrite. |
| 409 QuicStreamId currently_writing_stream_id_; | 405 QuicStreamId currently_writing_stream_id_; |
| 410 | 406 |
| 411 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 407 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 412 }; | 408 }; |
| 413 | 409 |
| 414 } // namespace net | 410 } // namespace net |
| 415 | 411 |
| 416 #endif // NET_QUIC_QUIC_SESSION_H_ | 412 #endif // NET_QUIC_QUIC_SESSION_H_ |
| OLD | NEW |