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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 virtual void OnModification(int fd, int event_mask) OVERRIDE {} | 52 virtual void OnModification(int fd, int event_mask) OVERRIDE {} |
53 virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE; | 53 virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE; |
54 virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {} | 54 virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {} |
55 | 55 |
56 // Reads a packet from the given fd, and then passes it off to | 56 // Reads a packet from the given fd, and then passes it off to |
57 // the QuicDispatcher. Returns true if a packet is read, false | 57 // the QuicDispatcher. Returns true if a packet is read, false |
58 // otherwise. | 58 // otherwise. |
59 // If packets_dropped is non-null, the socket is configured to track | 59 // If packets_dropped is non-null, the socket is configured to track |
60 // dropped packets, and some packets are read, it will be set to the number of | 60 // dropped packets, and some packets are read, it will be set to the number of |
61 // dropped packets. | 61 // dropped packets. |
62 static bool ReadAndDispatchSinglePacket(int fd, int port, | 62 static bool ReadAndDispatchSinglePacket(int fd, |
| 63 int port, |
63 QuicDispatcher* dispatcher, | 64 QuicDispatcher* dispatcher, |
64 uint32* packets_dropped); | 65 uint32* packets_dropped); |
65 | 66 |
66 virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {} | 67 virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {} |
67 | 68 |
68 void SetStrikeRegisterNoStartupPeriod() { | 69 void SetStrikeRegisterNoStartupPeriod() { |
69 crypto_config_.set_strike_register_no_startup_period(); | 70 crypto_config_.set_strike_register_no_startup_period(); |
70 } | 71 } |
71 | 72 |
72 // SetProofSource sets the ProofSource that will be used to verify the | 73 // SetProofSource sets the ProofSource that will be used to verify the |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // connections. | 127 // connections. |
127 uint32 server_initial_flow_control_receive_window_; | 128 uint32 server_initial_flow_control_receive_window_; |
128 | 129 |
129 DISALLOW_COPY_AND_ASSIGN(QuicServer); | 130 DISALLOW_COPY_AND_ASSIGN(QuicServer); |
130 }; | 131 }; |
131 | 132 |
132 } // namespace tools | 133 } // namespace tools |
133 } // namespace net | 134 } // namespace net |
134 | 135 |
135 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ | 136 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ |
OLD | NEW |