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 guids in time wait state by discarding the packet and | 5 // Handles packets for guids in time wait state by discarding the packet and |
6 // sending the clients a public reset packet with exponential backoff. | 6 // sending the clients a public reset packet with exponential backoff. |
7 | 7 |
8 #ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
9 #define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 9 #define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 | 12 |
13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
14 #include "base/string_piece.h" | 14 #include "base/string_piece.h" |
15 #include "net/quic/quic_blocked_writer_interface.h" | 15 #include "net/quic/quic_blocked_writer_interface.h" |
16 #include "net/quic/quic_framer.h" | 16 #include "net/quic/quic_framer.h" |
17 #include "net/quic/quic_protocol.h" | 17 #include "net/quic/quic_protocol.h" |
18 #include "net/tools/flip_server/epoll_server.h" | 18 #include "net/tools/flip_server/epoll_server.h" |
19 #include "net/tools/quic/quic_epoll_clock.h" | 19 #include "net/tools/quic/quic_epoll_clock.h" |
20 #include "net/tools/quic/quic_packet_writer.h" | 20 #include "net/tools/quic/quic_packet_writer.h" |
21 | 21 |
22 namespace net { | 22 namespace net { |
| 23 namespace tools { |
23 | 24 |
24 class GuidCleanUpAlarm; | 25 class GuidCleanUpAlarm; |
25 | 26 |
26 // Maintains a list of all guids that have been recently closed. A guid lives in | 27 // Maintains a list of all guids that have been recently closed. A guid lives in |
27 // this state for kTimeWaitPeriod. All packets received for guids in this state | 28 // this state for kTimeWaitPeriod. All packets received for guids in this state |
28 // are handed over to the QuicTimeWaitListManager by the QuicDispatcher. It also | 29 // are handed over to the QuicTimeWaitListManager by the QuicDispatcher. It also |
29 // decides whether we should send a public reset packet to the client which sent | 30 // decides whether we should send a public reset packet to the client which sent |
30 // a packet with the guid in time wait state and sends it when appropriate. | 31 // a packet with the guid in time wait state and sends it when appropriate. |
31 // After the guid expires its time wait period, a new connection/session will be | 32 // After the guid expires its time wait period, a new connection/session will be |
32 // created if a packet is received for this guid. | 33 // created if a packet is received for this guid. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Interface that writes given buffer to the socket. Owned by the dispatcher. | 169 // Interface that writes given buffer to the socket. Owned by the dispatcher. |
169 QuicPacketWriter* writer_; | 170 QuicPacketWriter* writer_; |
170 | 171 |
171 // True if the underlying udp socket is write blocked, i.e will return EAGAIN | 172 // True if the underlying udp socket is write blocked, i.e will return EAGAIN |
172 // on sendmsg. | 173 // on sendmsg. |
173 bool is_write_blocked_; | 174 bool is_write_blocked_; |
174 | 175 |
175 DISALLOW_COPY_AND_ASSIGN(QuicTimeWaitListManager); | 176 DISALLOW_COPY_AND_ASSIGN(QuicTimeWaitListManager); |
176 }; | 177 }; |
177 | 178 |
| 179 } // namespace tools |
178 } // namespace net | 180 } // namespace net |
179 | 181 |
180 #endif // NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 182 #endif // NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
OLD | NEW |