summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_server_base.h
blob: c84398fe13de97359575b6acde97767a92a26acd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// A toy server, which connects to a specified port and sends QUIC
// requests to that endpoint.

#ifndef QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_
#define QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_

#include "quic/platform/api/quic_socket_address.h"

namespace quic {

// Base class for service instances to be used with QuicToyServer.
class QuicSpdyServerBase {
 public:
  virtual ~QuicSpdyServerBase() = default;

  // Creates a UDP socket and listens on |address|. Returns true on success
  // and false otherwise.
  virtual bool CreateUDPSocketAndListen(const QuicSocketAddress& address) = 0;

  // Handles incoming requests. Does not return.
  virtual void HandleEventsForever() = 0;
};

}  // namespace quic

#endif  // QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_