Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: net/tools/quic/quic_server.h

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void OnUnregistration(int fd, bool replaced) override {} 51 void OnUnregistration(int fd, bool replaced) override {}
52 52
53 // Reads a packet from the given fd, and then passes it off to 53 // Reads a packet from the given fd, and then passes it off to
54 // the QuicDispatcher. Returns true if a packet is read, false 54 // the QuicDispatcher. Returns true if a packet is read, false
55 // otherwise. 55 // otherwise.
56 // If packets_dropped is non-null, the socket is configured to track 56 // If packets_dropped is non-null, the socket is configured to track
57 // dropped packets, and some packets are read, it will be set to the number of 57 // dropped packets, and some packets are read, it will be set to the number of
58 // dropped packets. 58 // dropped packets.
59 static bool ReadAndDispatchSinglePacket(int fd, int port, 59 static bool ReadAndDispatchSinglePacket(int fd, int port,
60 ProcessPacketInterface* processor, 60 ProcessPacketInterface* processor,
61 uint32* packets_dropped); 61 QuicPacketCount* packets_dropped);
62 62
63 void OnShutdown(EpollServer* eps, int fd) override {} 63 void OnShutdown(EpollServer* eps, int fd) override {}
64 64
65 void SetStrikeRegisterNoStartupPeriod() { 65 void SetStrikeRegisterNoStartupPeriod() {
66 crypto_config_.set_strike_register_no_startup_period(); 66 crypto_config_.set_strike_register_no_startup_period();
67 } 67 }
68 68
69 // SetProofSource sets the ProofSource that will be used to verify the 69 // SetProofSource sets the ProofSource that will be used to verify the
70 // server's certificate, and takes ownership of |source|. 70 // server's certificate, and takes ownership of |source|.
71 void SetProofSource(ProofSource* source) { 71 void SetProofSource(ProofSource* source) {
72 crypto_config_.SetProofSource(source); 72 crypto_config_.SetProofSource(source);
73 } 73 }
74 74
75 bool overflow_supported() { return overflow_supported_; } 75 bool overflow_supported() { return overflow_supported_; }
76 76
77 uint32 packets_dropped() { return packets_dropped_; } 77 QuicPacketCount packets_dropped() { return packets_dropped_; }
78 78
79 int port() { return port_; } 79 int port() { return port_; }
80 80
81 protected: 81 protected:
82 virtual QuicDispatcher* CreateQuicDispatcher(); 82 virtual QuicDispatcher* CreateQuicDispatcher();
83 83
84 const QuicConfig& config() const { return config_; } 84 const QuicConfig& config() const { return config_; }
85 const QuicCryptoServerConfig& crypto_config() const { 85 const QuicCryptoServerConfig& crypto_config() const {
86 return crypto_config_; 86 return crypto_config_;
87 } 87 }
(...skipping 15 matching lines...) Expand all
103 103
104 // The port the server is listening on. 104 // The port the server is listening on.
105 int port_; 105 int port_;
106 106
107 // Listening connection. Also used for outbound client communication. 107 // Listening connection. Also used for outbound client communication.
108 int fd_; 108 int fd_;
109 109
110 // If overflow_supported_ is true this will be the number of packets dropped 110 // If overflow_supported_ is true this will be the number of packets dropped
111 // during the lifetime of the server. This may overflow if enough packets 111 // during the lifetime of the server. This may overflow if enough packets
112 // are dropped. 112 // are dropped.
113 uint32 packets_dropped_; 113 QuicPacketCount packets_dropped_;
114 114
115 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped 115 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped
116 // because the socket would otherwise overflow. 116 // because the socket would otherwise overflow.
117 bool overflow_supported_; 117 bool overflow_supported_;
118 118
119 // If true, use recvmmsg for reading. 119 // If true, use recvmmsg for reading.
120 bool use_recvmmsg_; 120 bool use_recvmmsg_;
121 121
122 // config_ contains non-crypto parameters that are negotiated in the crypto 122 // config_ contains non-crypto parameters that are negotiated in the crypto
123 // handshake. 123 // handshake.
(...skipping 11 matching lines...) Expand all
135 // connections. 135 // connections.
136 uint32 server_initial_flow_control_receive_window_; 136 uint32 server_initial_flow_control_receive_window_;
137 137
138 DISALLOW_COPY_AND_ASSIGN(QuicServer); 138 DISALLOW_COPY_AND_ASSIGN(QuicServer);
139 }; 139 };
140 140
141 } // namespace tools 141 } // namespace tools
142 } // namespace net 142 } // namespace net
143 143
144 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ 144 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698