proxygen
HTTPAcceptor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <memory>
18 
19 namespace proxygen {
20 
22  public:
23  explicit HTTPAcceptor(const AcceptorConfiguration& accConfig)
24  : Acceptor(accConfig)
25  , accConfig_(accConfig) {}
26 
30  bool isInternal() const {
31  return accConfig_.internal;
32  }
33 
38  return *timer_;
39  }
40 
41  void init(folly::AsyncServerSocket* serverSocket,
42  folly::EventBase* eventBase,
43  wangle::SSLStats* /*stat*/ = nullptr) override {
44  timer_ = std::make_unique<WheelTimerInstance>(
46  Acceptor::init(serverSocket, eventBase);
47  }
48 
49  const AcceptorConfiguration& getConfig() const { return accConfig_; }
50 
51  protected:
53  private:
55  std::unique_ptr<WheelTimerInstance> timer_;
56 };
57 
58 }
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52
std::chrono::milliseconds transactionIdleTimeout
virtual const WheelTimerInstance & getTransactionTimeoutSet()
Definition: HTTPAcceptor.h:37
void init(folly::AsyncServerSocket *serverSocket, folly::EventBase *eventBase, wangle::SSLStats *=nullptr) override
Definition: HTTPAcceptor.h:41
void init()
Acceptor(const ServerSocketConfig &accConfig)
Definition: Acceptor.cpp:54
std::unique_ptr< WheelTimerInstance > timer_
Definition: HTTPAcceptor.h:55
HTTPAcceptor(const AcceptorConfiguration &accConfig)
Definition: HTTPAcceptor.h:23
const AcceptorConfiguration & getConfig() const
Definition: HTTPAcceptor.h:49
bool isInternal() const
Definition: HTTPAcceptor.h:30
AsyncTimeoutSet::UniquePtr tcpEventsTimeouts_
Definition: HTTPAcceptor.h:54
std::unique_ptr< AsyncTimeoutSet, Destructor > UniquePtr