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 server side dispatcher which dispatches a given client's data to their | 5 // A server side dispatcher which dispatches a given client's data to their |
6 // stream. | 6 // stream. |
7 | 7 |
8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 public ProcessPacketInterface, | 37 public ProcessPacketInterface, |
38 public QuicBlockedWriterInterface, | 38 public QuicBlockedWriterInterface, |
39 public QuicFramerVisitorInterface { | 39 public QuicFramerVisitorInterface { |
40 public: | 40 public: |
41 // Ideally we'd have a linked_hash_set: the boolean is unused. | 41 // Ideally we'd have a linked_hash_set: the boolean is unused. |
42 typedef linked_hash_map<QuicBlockedWriterInterface*, | 42 typedef linked_hash_map<QuicBlockedWriterInterface*, |
43 bool, | 43 bool, |
44 QuicBlockedWriterInterfacePtrHash> | 44 QuicBlockedWriterInterfacePtrHash> |
45 WriteBlockedList; | 45 WriteBlockedList; |
46 | 46 |
47 // Due to the way delete_sessions_closure_ is registered, the Dispatcher must | |
48 // live until server Shutdown. |supported_versions| specifies the std::list | |
49 // of supported QUIC versions. Takes ownership of |packet_writer_factory|, | |
50 // which is used to create per-connection writers. | |
51 QuicDispatcher(const QuicConfig& config, | 47 QuicDispatcher(const QuicConfig& config, |
52 const QuicCryptoServerConfig* crypto_config, | 48 const QuicCryptoServerConfig* crypto_config, |
53 const QuicVersionVector& supported_versions, | 49 const QuicVersionVector& supported_versions, |
54 QuicConnectionHelperInterface* helper); | 50 std::unique_ptr<QuicConnectionHelperInterface> helper); |
55 | 51 |
56 ~QuicDispatcher() override; | 52 ~QuicDispatcher() override; |
57 | 53 |
58 // Takes ownership of |writer|. | 54 // Takes ownership of |writer|. |
59 void InitializeWithWriter(QuicPacketWriter* writer); | 55 void InitializeWithWriter(QuicPacketWriter* writer); |
60 | 56 |
61 // Process the incoming packet by creating a new session, passing it to | 57 // Process the incoming packet by creating a new session, passing it to |
62 // an existing session, or passing it to the time wait list. | 58 // an existing session, or passing it to the time wait list. |
63 void ProcessPacket(const IPEndPoint& server_address, | 59 void ProcessPacket(const IPEndPoint& server_address, |
64 const IPEndPoint& client_address, | 60 const IPEndPoint& client_address, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // The last error set by SetLastError(), which is called by | 261 // The last error set by SetLastError(), which is called by |
266 // framer_visitor_->OnError(). | 262 // framer_visitor_->OnError(). |
267 QuicErrorCode last_error_; | 263 QuicErrorCode last_error_; |
268 | 264 |
269 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 265 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
270 }; | 266 }; |
271 | 267 |
272 } // namespace net | 268 } // namespace net |
273 | 269 |
274 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 270 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
OLD | NEW |