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 // Handles packets for connection_ids in time wait state by discarding the | 5 // Handles packets for connection_ids in time wait state by discarding the |
6 // packet and sending the clients a public reset packet with exponential | 6 // packet and sending the clients a public reset packet with exponential |
7 // backoff. | 7 // backoff. |
8 | 8 |
9 #ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 9 #ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
10 #define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 10 #define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
(...skipping 25 matching lines...) Expand all Loading... |
36 // QuicTimeWaitListManager by the QuicDispatcher. Decides whether to send a | 36 // QuicTimeWaitListManager by the QuicDispatcher. Decides whether to send a |
37 // public reset packet, a copy of the previously sent connection close packet, | 37 // public reset packet, a copy of the previously sent connection close packet, |
38 // or nothing to the client which sent a packet with the connection_id in time | 38 // or nothing to the client which sent a packet with the connection_id in time |
39 // wait state. After the connection_id expires its time wait period, a new | 39 // wait state. After the connection_id expires its time wait period, a new |
40 // connection/session will be created if a packet is received for this | 40 // connection/session will be created if a packet is received for this |
41 // connection_id. | 41 // connection_id. |
42 class QuicTimeWaitListManager : public QuicBlockedWriterInterface { | 42 class QuicTimeWaitListManager : public QuicBlockedWriterInterface { |
43 public: | 43 public: |
44 // writer - the entity that writes to the socket. (Owned by the dispatcher) | 44 // writer - the entity that writes to the socket. (Owned by the dispatcher) |
45 // visitor - the entity that manages blocked writers. (The dispatcher) | 45 // visitor - the entity that manages blocked writers. (The dispatcher) |
46 // helper - used to run clean up alarms. (Owned by the dispatcher) | 46 // helper - provides a clock (Owned by the dispatcher) |
| 47 // alarm_factory - used to run clean up alarms. (Owned by the dispatcher) |
47 QuicTimeWaitListManager(QuicPacketWriter* writer, | 48 QuicTimeWaitListManager(QuicPacketWriter* writer, |
48 QuicServerSessionVisitor* visitor, | 49 QuicServerSessionVisitor* visitor, |
49 QuicConnectionHelperInterface* helper); | 50 QuicConnectionHelperInterface* helper, |
| 51 QuicAlarmFactory* alarm_factory); |
50 ~QuicTimeWaitListManager() override; | 52 ~QuicTimeWaitListManager() override; |
51 | 53 |
52 // Adds the given connection_id to time wait state for time_wait_period_. | 54 // Adds the given connection_id to time wait state for time_wait_period_. |
53 // If |termination_packets| are provided, copies of these packets will be sent | 55 // If |termination_packets| are provided, copies of these packets will be sent |
54 // when a packet with this connection ID is processed. If no termination | 56 // when a packet with this connection ID is processed. If no termination |
55 // packets are provided, then a PUBLIC_RESET will be sent with the specified | 57 // packets are provided, then a PUBLIC_RESET will be sent with the specified |
56 // |version|. Any termination packets will be move from |termination_packets| | 58 // |version|. Any termination packets will be move from |termination_packets| |
57 // and will become owned by the manager. If |connection_rejected_statelessly| | 59 // and will become owned by the manager. If |connection_rejected_statelessly| |
58 // is true, it means that the connection was closed due to a stateless reject, | 60 // is true, it means that the connection was closed due to a stateless reject, |
59 // and termination packets are expected. | 61 // and termination packets are expected. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 195 |
194 // Interface that manages blocked writers. | 196 // Interface that manages blocked writers. |
195 QuicServerSessionVisitor* visitor_; | 197 QuicServerSessionVisitor* visitor_; |
196 | 198 |
197 DISALLOW_COPY_AND_ASSIGN(QuicTimeWaitListManager); | 199 DISALLOW_COPY_AND_ASSIGN(QuicTimeWaitListManager); |
198 }; | 200 }; |
199 | 201 |
200 } // namespace net | 202 } // namespace net |
201 | 203 |
202 #endif // NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 204 #endif // NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
OLD | NEW |