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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "net/base/ip_endpoint.h" | 13 #include "net/base/ip_endpoint.h" |
14 #include "net/quic/crypto/quic_crypto_server_config.h" | 14 #include "net/quic/crypto/quic_crypto_server_config.h" |
15 #include "net/quic/quic_config.h" | 15 #include "net/quic/quic_config.h" |
16 #include "net/quic/quic_connection_helper.h" | 16 #include "net/quic/quic_connection_helper.h" |
17 #include "net/quic/quic_framer.h" | 17 #include "net/quic/quic_framer.h" |
18 #include "net/tools/epoll_server/epoll_server.h" | 18 #include "net/tools/epoll_server/epoll_server.h" |
| 19 #include "net/tools/quic/quic_default_packet_writer.h" |
19 | 20 |
20 namespace net { | 21 namespace net { |
21 | 22 |
22 namespace tools { | 23 namespace tools { |
23 | 24 |
24 namespace test { | 25 namespace test { |
25 class QuicServerPeer; | 26 class QuicServerPeer; |
26 } // namespace test | 27 } // namespace test |
27 | 28 |
28 class ProcessPacketInterface; | 29 class ProcessPacketInterface; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 crypto_config_.SetProofSource(source); | 75 crypto_config_.SetProofSource(source); |
75 } | 76 } |
76 | 77 |
77 bool overflow_supported() { return overflow_supported_; } | 78 bool overflow_supported() { return overflow_supported_; } |
78 | 79 |
79 QuicPacketCount packets_dropped() { return packets_dropped_; } | 80 QuicPacketCount packets_dropped() { return packets_dropped_; } |
80 | 81 |
81 int port() { return port_; } | 82 int port() { return port_; } |
82 | 83 |
83 protected: | 84 protected: |
| 85 virtual QuicDefaultPacketWriter* CreateWriter(int fd); |
| 86 |
84 virtual QuicDispatcher* CreateQuicDispatcher(); | 87 virtual QuicDispatcher* CreateQuicDispatcher(); |
85 | 88 |
86 const QuicConfig& config() const { return config_; } | 89 const QuicConfig& config() const { return config_; } |
87 const QuicCryptoServerConfig& crypto_config() const { | 90 const QuicCryptoServerConfig& crypto_config() const { |
88 return crypto_config_; | 91 return crypto_config_; |
89 } | 92 } |
90 const QuicVersionVector& supported_versions() const { | 93 const QuicVersionVector& supported_versions() const { |
91 return supported_versions_; | 94 return supported_versions_; |
92 } | 95 } |
93 EpollServer* epoll_server() { return &epoll_server_; } | 96 EpollServer* epoll_server() { return &epoll_server_; } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 140 |
138 scoped_ptr<QuicPacketReader> packet_reader_; | 141 scoped_ptr<QuicPacketReader> packet_reader_; |
139 | 142 |
140 DISALLOW_COPY_AND_ASSIGN(QuicServer); | 143 DISALLOW_COPY_AND_ASSIGN(QuicServer); |
141 }; | 144 }; |
142 | 145 |
143 } // namespace tools | 146 } // namespace tools |
144 } // namespace net | 147 } // namespace net |
145 | 148 |
146 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ | 149 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ |
OLD | NEW |