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 toy server, which listens on a specified address for QUIC traffic and | 5 // A toy server, which listens on a specified address for QUIC traffic and |
6 // handles incoming responses. | 6 // handles incoming responses. |
7 | 7 |
8 #ifndef NET_TOOLS_QUIC_QUIC_SERVER_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_SERVER_H_ |
9 #define NET_TOOLS_QUIC_QUIC_SERVER_H_ | 9 #define NET_TOOLS_QUIC_QUIC_SERVER_H_ |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void SetProofSource(ProofSource* source) { | 73 void SetProofSource(ProofSource* source) { |
74 crypto_config_.SetProofSource(source); | 74 crypto_config_.SetProofSource(source); |
75 } | 75 } |
76 | 76 |
77 bool overflow_supported() { return overflow_supported_; } | 77 bool overflow_supported() { return overflow_supported_; } |
78 | 78 |
79 uint32 packets_dropped() { return packets_dropped_; } | 79 uint32 packets_dropped() { return packets_dropped_; } |
80 | 80 |
81 int port() { return port_; } | 81 int port() { return port_; } |
82 | 82 |
| 83 protected: |
| 84 virtual QuicDispatcher* CreateQuicDispatcher(); |
| 85 |
| 86 const QuicConfig& config() const { return config_; } |
| 87 const QuicCryptoServerConfig& crypto_config() const { |
| 88 return crypto_config_; |
| 89 } |
| 90 const QuicVersionVector& supported_versions() const { |
| 91 return supported_versions_; |
| 92 } |
| 93 EpollServer* epoll_server() { return &epoll_server_; } |
| 94 |
83 private: | 95 private: |
84 friend class net::tools::test::QuicServerPeer; | 96 friend class net::tools::test::QuicServerPeer; |
85 | 97 |
86 // Initialize the internal state of the server. | 98 // Initialize the internal state of the server. |
87 void Initialize(); | 99 void Initialize(); |
88 | 100 |
89 // Accepts data from the framer and demuxes clients to sessions. | 101 // Accepts data from the framer and demuxes clients to sessions. |
90 scoped_ptr<QuicDispatcher> dispatcher_; | 102 scoped_ptr<QuicDispatcher> dispatcher_; |
91 // Frames incoming packets and hands them to the dispatcher. | 103 // Frames incoming packets and hands them to the dispatcher. |
92 EpollServer epoll_server_; | 104 EpollServer epoll_server_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // connections. | 137 // connections. |
126 uint32 server_initial_flow_control_receive_window_; | 138 uint32 server_initial_flow_control_receive_window_; |
127 | 139 |
128 DISALLOW_COPY_AND_ASSIGN(QuicServer); | 140 DISALLOW_COPY_AND_ASSIGN(QuicServer); |
129 }; | 141 }; |
130 | 142 |
131 } // namespace tools | 143 } // namespace tools |
132 } // namespace net | 144 } // namespace net |
133 | 145 |
134 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ | 146 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ |
OLD | NEW |