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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 const IPEndPoint& server_address, | 119 const IPEndPoint& server_address, |
120 const IPEndPoint& client_address); | 120 const IPEndPoint& client_address); |
121 | 121 |
122 // Replaces the packet writer with |writer|. Takes ownership of |writer|. | 122 // Replaces the packet writer with |writer|. Takes ownership of |writer|. |
123 void set_writer(QuicPacketWriter* writer); | 123 void set_writer(QuicPacketWriter* writer); |
124 | 124 |
125 QuicTimeWaitListManager* time_wait_list_manager() { | 125 QuicTimeWaitListManager* time_wait_list_manager() { |
126 return time_wait_list_manager_.get(); | 126 return time_wait_list_manager_.get(); |
127 } | 127 } |
128 | 128 |
129 QuicEpollConnectionHelper* helper() { return helper_.get(); } | |
130 EpollServer* epoll_server() { return epoll_server_; } | 129 EpollServer* epoll_server() { return epoll_server_; } |
131 | 130 |
132 const QuicVersionVector& supported_versions() const { | 131 const QuicVersionVector& supported_versions() const { |
133 return supported_versions_; | 132 return supported_versions_; |
134 } | 133 } |
135 | 134 |
136 // Called by |framer_visitor_| when the public header has been parsed. | 135 // Called by |framer_visitor_| when the public header has been parsed. |
137 virtual bool OnUnauthenticatedPublicHeader( | 136 virtual bool OnUnauthenticatedPublicHeader( |
138 const QuicPacketPublicHeader& header); | 137 const QuicPacketPublicHeader& header); |
139 | 138 |
140 // Information about the packet currently being dispatched. | |
141 const IPEndPoint& current_client_address() { | |
142 return current_client_address_; | |
143 } | |
144 const IPEndPoint& current_server_address() { | 139 const IPEndPoint& current_server_address() { |
145 return current_server_address_; | 140 return current_server_address_; |
146 } | 141 } |
147 const QuicEncryptedPacket& current_packet() { | 142 const QuicEncryptedPacket& current_packet() { |
148 return *current_packet_; | 143 return *current_packet_; |
149 } | 144 } |
150 | 145 |
151 const QuicConfig& config() const { return config_; } | 146 const QuicConfig& config() const { return config_; } |
152 | 147 |
153 const QuicCryptoServerConfig& crypto_config() const { return crypto_config_; } | 148 const QuicCryptoServerConfig& crypto_config() const { return crypto_config_; } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 QuicFramer framer_; | 203 QuicFramer framer_; |
209 scoped_ptr<QuicFramerVisitor> framer_visitor_; | 204 scoped_ptr<QuicFramerVisitor> framer_visitor_; |
210 | 205 |
211 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 206 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
212 }; | 207 }; |
213 | 208 |
214 } // namespace tools | 209 } // namespace tools |
215 } // namespace net | 210 } // namespace net |
216 | 211 |
217 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 212 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
OLD | NEW |