rch | 034c98c | 2019-05-17 15:46:09 -0700 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // A toy server, which connects to a specified port and sends QUIC |
| 6 | // requests to that endpoint. |
| 7 | |
| 8 | #ifndef QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_ |
| 9 | #define QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_ |
| 10 | |
| 11 | #include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h" |
| 12 | |
| 13 | namespace quic { |
| 14 | |
| 15 | // Base class for service instances to be used with QuicToyServer. |
| 16 | class QuicSpdyServerBase { |
| 17 | public: |
| 18 | virtual ~QuicSpdyServerBase() = default; |
| 19 | |
| 20 | // Creates a UDP socket and listens on |address|. Returns true on success |
| 21 | // and false otherwise. |
| 22 | virtual bool CreateUDPSocketAndListen(const QuicSocketAddress& address) = 0; |
| 23 | |
| 24 | // Handles incoming requests. Does not return. |
| 25 | virtual void HandleEventsForever() = 0; |
| 26 | }; |
| 27 | |
| 28 | } // namespace quic |
| 29 | |
| 30 | #endif // QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_ |