blob: 1130cfcba4e218f51e2417a2762ab9913f85c782 [file] [log] [blame]
rch034c98c2019-05-17 15:46:09 -07001// 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
13namespace quic {
14
15// Base class for service instances to be used with QuicToyServer.
16class 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_