| 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 // Note that this server is intended to verify correctness of the client and is | 8 // Note that this server is intended to verify correctness of the client and is |
| 9 // in no way expected to be performant. | 9 // in no way expected to be performant. |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 public: | 36 public: |
| 37 explicit QuicServer(ProofSource* proof_source); | 37 explicit QuicServer(ProofSource* proof_source); |
| 38 QuicServer(ProofSource* proof_source, | 38 QuicServer(ProofSource* proof_source, |
| 39 const QuicConfig& config, | 39 const QuicConfig& config, |
| 40 const QuicCryptoServerConfig::ConfigOptions& server_config_options, | 40 const QuicCryptoServerConfig::ConfigOptions& server_config_options, |
| 41 const QuicVersionVector& supported_versions); | 41 const QuicVersionVector& supported_versions); |
| 42 | 42 |
| 43 ~QuicServer() override; | 43 ~QuicServer() override; |
| 44 | 44 |
| 45 // Start listening on the specified address. | 45 // Start listening on the specified address. |
| 46 bool Listen(const IPEndPoint& address); | 46 bool CreateUDPSocketAndListen(const IPEndPoint& address); |
| 47 | 47 |
| 48 // Wait up to 50ms, and handle any events which occur. | 48 // Wait up to 50ms, and handle any events which occur. |
| 49 void WaitForEvents(); | 49 void WaitForEvents(); |
| 50 | 50 |
| 51 // Server deletion is imminent. Start cleaning up the epoll server. | 51 // Server deletion is imminent. Start cleaning up the epoll server. |
| 52 void Shutdown(); | 52 void Shutdown(); |
| 53 | 53 |
| 54 // From EpollCallbackInterface | 54 // From EpollCallbackInterface |
| 55 void OnRegistration(EpollServer* eps, int fd, int event_mask) override {} | 55 void OnRegistration(EpollServer* eps, int fd, int event_mask) override {} |
| 56 void OnModification(int fd, int event_mask) override {} | 56 void OnModification(int fd, int event_mask) override {} |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 QuicVersionVector supported_versions_; | 131 QuicVersionVector supported_versions_; |
| 132 | 132 |
| 133 scoped_ptr<QuicPacketReader> packet_reader_; | 133 scoped_ptr<QuicPacketReader> packet_reader_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(QuicServer); | 135 DISALLOW_COPY_AND_ASSIGN(QuicServer); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace net | 138 } // namespace net |
| 139 | 139 |
| 140 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ | 140 #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_ |
| OLD | NEW |