Go to the source code of this file.
|
| DEFINE_int32 (http_port, 11000,"Port to listen on with HTTP protocol") |
|
| DEFINE_int32 (spdy_port, 11001,"Port to listen on with SPDY protocol") |
|
| DEFINE_int32 (h2_port, 11002,"Port to listen on with HTTP/2 protocol") |
|
| DEFINE_string (ip,"localhost","IP/Hostname to bind to") |
|
| DEFINE_int32 (threads, 0,"Number of threads to listen on. Numbers <= 0 ""will use the number of cores on this machine.") |
|
int | main (int argc, char *argv[]) |
|
DEFINE_int32 |
( |
http_port |
, |
|
|
11000 |
, |
|
|
"Port to listen on with HTTP protocol" |
|
|
) |
| |
DEFINE_int32 |
( |
spdy_port |
, |
|
|
11001 |
, |
|
|
"Port to listen on with SPDY protocol" |
|
|
) |
| |
DEFINE_int32 |
( |
h2_port |
, |
|
|
11002 |
, |
|
|
"Port to listen on with HTTP/2 protocol" |
|
|
) |
| |
DEFINE_int32 |
( |
threads |
, |
|
|
0 |
, |
|
|
"Number of threads to listen on. Numbers <= 0 ""will use the number of cores on this machine." |
|
|
) |
| |
DEFINE_string |
( |
ip |
, |
|
|
"localhost" |
, |
|
|
"IP/Hostname to bind to" |
|
|
) |
| |
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 54 of file PushServer.cpp.
References proxygen::RequestHandlerChain::addThen(), proxygen::HTTPServer::bind(), proxygen::HTTPServerOptions::enableContentCompression, proxygen::HTTPServerOptions::handlerFactories, proxygen::HTTPServerOptions::idleTimeout, folly::gen::move, proxygen::HTTPServerOptions::shutdownOn, proxygen::HTTPServer::start(), folly::pushmi::detail::t, and proxygen::HTTPServerOptions::threads.
55 gflags::ParseCommandLineFlags(&argc, &
argv,
true);
56 google::InitGoogleLogging(
argv[0]);
57 google::InstallFailureSignalHandler();
59 std::vector<HTTPServer::IPConfig> IPs = {
60 {
SocketAddress(FLAGS_ip, FLAGS_http_port,
true), Protocol::HTTP},
61 {
SocketAddress(FLAGS_ip, FLAGS_spdy_port,
true), Protocol::SPDY},
62 {
SocketAddress(FLAGS_ip, FLAGS_h2_port,
true), Protocol::HTTP2},
65 if (FLAGS_threads <= 0) {
66 FLAGS_threads = sysconf(_SC_NPROCESSORS_ONLN);
67 CHECK(FLAGS_threads > 0);
71 options.
threads =
static_cast<size_t>(FLAGS_threads);
72 options.
idleTimeout = std::chrono::milliseconds(60000);
83 std::thread
t([&] () {
std::chrono::milliseconds idleTimeout
constexpr detail::Map< Move > move
RequestHandlerChain & addThen(Args &&...args)
std::vector< std::unique_ptr< RequestHandlerFactory > > handlerFactories
std::vector< int > shutdownOn
bool enableContentCompression