| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 server specific QuicSession subclass. | 5 // A server specific QuicSession subclass. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_QUIC_SERVER_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SERVER_SESSION_H_ |
| 8 #define NET_QUIC_QUIC_SERVER_SESSION_H_ | 8 #define NET_QUIC_QUIC_SERVER_SESSION_H_ |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } // namespace test | 26 } // namespace test |
| 27 | 27 |
| 28 class QuicBlockedWriterInterface; | 28 class QuicBlockedWriterInterface; |
| 29 class QuicConfig; | 29 class QuicConfig; |
| 30 class QuicConnection; | 30 class QuicConnection; |
| 31 class QuicCryptoServerConfig; | 31 class QuicCryptoServerConfig; |
| 32 class ReliableQuicStream; | 32 class ReliableQuicStream; |
| 33 | 33 |
| 34 // An interface from the session to the entity owning the session. | 34 // An interface from the session to the entity owning the session. |
| 35 // This lets the session notify its owner (the Dispatcher) when the connection | 35 // This lets the session notify its owner (the Dispatcher) when the connection |
| 36 // is closed or blocked. | 36 // is closed, blocked, or added/removed from the time-wait list. |
| 37 class QuicServerSessionVisitor { | 37 class QuicServerSessionVisitor { |
| 38 public: | 38 public: |
| 39 virtual ~QuicServerSessionVisitor() {} | 39 virtual ~QuicServerSessionVisitor() {} |
| 40 | 40 |
| 41 virtual void OnConnectionClosed(QuicConnectionId connection_id, | 41 virtual void OnConnectionClosed(QuicConnectionId connection_id, |
| 42 QuicErrorCode error) = 0; | 42 QuicErrorCode error) = 0; |
| 43 virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0; | 43 virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0; |
| 44 // Called after the given connection is added to the time-wait list. |
| 45 virtual void OnConnectionAddedToTimeWaitList(QuicConnectionId connection_id) { |
| 46 } |
| 47 // Called after the given connection is removed from the time-wait list. |
| 48 virtual void OnConnectionRemovedFromTimeWaitList( |
| 49 QuicConnectionId connection_id) {} |
| 44 }; | 50 }; |
| 45 | 51 |
| 46 class QuicServerSession : public QuicSession { | 52 class QuicServerSession : public QuicSession { |
| 47 public: | 53 public: |
| 48 QuicServerSession(const QuicConfig& config, | 54 QuicServerSession(const QuicConfig& config, |
| 49 QuicConnection* connection, | 55 QuicConnection* connection, |
| 50 QuicServerSessionVisitor* visitor); | 56 QuicServerSessionVisitor* visitor); |
| 51 | 57 |
| 52 // Override the base class to notify the owner of the connection close. | 58 // Override the base class to notify the owner of the connection close. |
| 53 void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; | 59 void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 110 |
| 105 // Number of packets sent to the peer, at the time we last sent a SCUP. | 111 // Number of packets sent to the peer, at the time we last sent a SCUP. |
| 106 int64 last_scup_sequence_number_; | 112 int64 last_scup_sequence_number_; |
| 107 | 113 |
| 108 DISALLOW_COPY_AND_ASSIGN(QuicServerSession); | 114 DISALLOW_COPY_AND_ASSIGN(QuicServerSession); |
| 109 }; | 115 }; |
| 110 | 116 |
| 111 } // namespace net | 117 } // namespace net |
| 112 | 118 |
| 113 #endif // NET_QUIC_QUIC_SERVER_SESSION_H_ | 119 #endif // NET_QUIC_QUIC_SERVER_SESSION_H_ |
| OLD | NEW |