Savarese Software Research Corporation
FCGIServiceOptions.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006-2009 Savarese Software Research Corporation
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     https://www.savarese.com/software/ApacheLicense-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00022 #ifndef __SSRC_WSPR_FCGI_SERVICE_OPTIONS_H
00023 #define __SSRC_WSPR_FCGI_SERVICE_OPTIONS_H
00024 
00025 #include <ssrc/wispers/utility/service_main.h>
00026 
00027 __BEGIN_NS_SSRC_WSPR_FCGI
00028 
00029 using std::string;
00030 using NS_SSRC_WSPR_UTILITY::ServiceMainOptions;
00031 
00032 template<typename Initializer>
00033 class FCGIServiceOptions : public ServiceMainOptions {
00034   typedef ServiceMainOptions super;
00035   boost::program_options::options_description _fcgi_description;
00036 
00037 protected:
00038 
00039   FCGIServiceOptions() :
00040     super(), _fcgi_description("FCGI"), initializer()
00041   {
00042     using namespace boost::program_options;
00043 
00044     _fcgi_description.add_options()
00045       ("socket,s", value<string>(&initializer.fcgi_socket),
00046        "The name of the socket to use for FCGI communication.  A path name "
00047        "is interpreted as a Unix domain socket.  A name of the form "
00048        "hostname:port or :port is treated as a TCP socket.  Do not specify "
00049        "if using an FCGI auto-spawner that creates a socket and forks, "
00050        "duping the socket to STDIN.")
00051       ("backlog,b",
00052        value<unsigned int>(&initializer.fcgi_backlog)->default_value(1024),
00053        "The listen queue depth for the FCGI socket.  This value takes effect "
00054        "only in conjunction with --socket.");
00055 
00056     description.add(_fcgi_description);
00057   }
00058 
00059 public:
00060   Initializer initializer;
00061 
00062   virtual ~FCGIServiceOptions() { }
00063 };
00064 
00065 __END_NS_SSRC_WSPR_FCGI
00066 
00067 #endif

Savarese Software Research Corporation
Copyright © 2006-2011 Savarese Software Research Corporation. All rights reserved.