OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 8 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
9 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 9 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void Shutdown(); | 48 void Shutdown(); |
49 | 49 |
50 // Start reading on the socket. On asynchronous reads, this registers | 50 // Start reading on the socket. On asynchronous reads, this registers |
51 // OnReadComplete as the callback, which will then call StartReading again. | 51 // OnReadComplete as the callback, which will then call StartReading again. |
52 void StartReading(); | 52 void StartReading(); |
53 | 53 |
54 // Called on reads that complete asynchronously. Dispatches the packet and | 54 // Called on reads that complete asynchronously. Dispatches the packet and |
55 // continues the read loop. | 55 // continues the read loop. |
56 void OnReadComplete(int result); | 56 void OnReadComplete(int result); |
57 | 57 |
58 void SetStrikeRegisterNoStartupPeriod() { | |
59 crypto_config_.set_strike_register_no_startup_period(); | |
60 } | |
61 | |
62 QuicDispatcher* dispatcher() { return dispatcher_.get(); } | 58 QuicDispatcher* dispatcher() { return dispatcher_.get(); } |
63 | 59 |
64 IPEndPoint server_address() const { return server_address_; } | 60 IPEndPoint server_address() const { return server_address_; } |
65 | 61 |
66 private: | 62 private: |
67 friend class test::QuicSimpleServerPeer; | 63 friend class test::QuicSimpleServerPeer; |
68 | 64 |
69 // Initialize the internal state of the server. | 65 // Initialize the internal state of the server. |
70 void Initialize(); | 66 void Initialize(); |
71 | 67 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 NetLog net_log_; | 112 NetLog net_log_; |
117 | 113 |
118 base::WeakPtrFactory<QuicSimpleServer> weak_factory_; | 114 base::WeakPtrFactory<QuicSimpleServer> weak_factory_; |
119 | 115 |
120 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServer); | 116 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServer); |
121 }; | 117 }; |
122 | 118 |
123 } // namespace net | 119 } // namespace net |
124 | 120 |
125 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 121 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
OLD | NEW |