xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/tools/quic_spdy_server_base.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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 "quiche/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_
31