| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // Sends ConnectionClose frames to all connected clients. | 91 // Sends ConnectionClose frames to all connected clients. |
| 92 void Shutdown(); | 92 void Shutdown(); |
| 93 | 93 |
| 94 // QuicServerSessionVisitor interface implementation: | 94 // QuicServerSessionVisitor interface implementation: |
| 95 // Ensure that the closed connection is cleaned up asynchronously. | 95 // Ensure that the closed connection is cleaned up asynchronously. |
| 96 virtual void OnConnectionClosed(QuicConnectionId connection_id, | 96 virtual void OnConnectionClosed(QuicConnectionId connection_id, |
| 97 QuicErrorCode error) OVERRIDE; | 97 QuicErrorCode error) OVERRIDE; |
| 98 | 98 |
| 99 // Queues the blocked writer for later resumption. | 99 // Queues the blocked writer for later resumption. |
| 100 virtual void OnWriteBlocked(QuicBlockedWriterInterface* writer) OVERRIDE; | 100 virtual void OnWriteBlocked( |
| 101 QuicBlockedWriterInterface* blocked_writer) OVERRIDE; |
| 101 | 102 |
| 102 typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap; | 103 typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap; |
| 103 | 104 |
| 104 // Deletes all sessions on the closed session list and clears the list. | 105 // Deletes all sessions on the closed session list and clears the list. |
| 105 void DeleteSessions(); | 106 void DeleteSessions(); |
| 106 | 107 |
| 107 const SessionMap& session_map() const { return session_map_; } | 108 const SessionMap& session_map() const { return session_map_; } |
| 108 | 109 |
| 109 WriteBlockedList* write_blocked_list() { return &write_blocked_list_; } | |
| 110 | |
| 111 protected: | 110 protected: |
| 112 // Instantiates a new low-level packet writer. Caller takes ownership of the | 111 // Instantiates a new low-level packet writer. Caller takes ownership of the |
| 113 // returned object. | 112 // returned object. |
| 114 virtual QuicPacketWriter* CreateWriter(int fd); | 113 virtual QuicPacketWriter* CreateWriter(int fd); |
| 115 | 114 |
| 116 virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, | 115 virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, |
| 117 const IPEndPoint& server_address, | 116 const IPEndPoint& server_address, |
| 118 const IPEndPoint& client_address); | 117 const IPEndPoint& client_address); |
| 119 | 118 |
| 120 virtual QuicConnection* CreateQuicConnection( | 119 virtual QuicConnection* CreateQuicConnection( |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 QuicFramer framer_; | 231 QuicFramer framer_; |
| 233 scoped_ptr<QuicFramerVisitor> framer_visitor_; | 232 scoped_ptr<QuicFramerVisitor> framer_visitor_; |
| 234 | 233 |
| 235 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 234 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
| 236 }; | 235 }; |
| 237 | 236 |
| 238 } // namespace tools | 237 } // namespace tools |
| 239 } // namespace net | 238 } // namespace net |
| 240 | 239 |
| 241 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 240 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
| OLD | NEW |