Public Member Functions |
| Tntnet () |
| Initialize a default Tntnet-application without mappings.
|
void | init (const TntConfig &config) |
| Initialize from global configuration.
|
void | listen (const std::string &ipaddr, unsigned short int port) |
| Set up a listener on the specified ip address and port.
|
void | listen (unsigned short int port) |
| Listen on all local interfaces on the specified port.
|
void | sslListen (const std::string &certificateFile, const std::string &keyFile, const std::string &ipaddr, unsigned short int port) |
| Set up a ssl listener on the specified ip address and port.
|
void | sslListen (const std::string &certificateFile, const std::string &keyFile, unsigned short int port) |
| Listen on all local interfaces on the specified port for ssl requests.
|
void | run () |
| Starts all needed threads and the application loop.
|
Jobqueue & | getQueue () |
| Returns the queue, which helds active http requests.
|
Poller & | getPoller () |
| Returns a reference to the poller thread object.
|
const Dispatcher & | getDispatcher () const |
| Returns a reference to the dispatcher object.
|
ScopeManager & | getScopemanager () |
| Returns a reference to the scope manager object.
|
unsigned | getMinThreads () const |
| Returns the minimum number of worker threads.
|
void | setMinThreads (unsigned n) |
| Sets the minimum number of worker threads.
|
unsigned | getMaxThreads () const |
| Returns the maximum number of worker threads.
|
void | setMaxThreads (unsigned n) |
| Sets the maximum number of worker threads.
|
Mapping & | mapUrl (const std::string &url, const std::string &ci) |
| Adds a mapping from a url to a component.
|
void | mapUrl (const std::string &url, const std::string &pathinfo, const std::string &ci_) |
Mapping & | mapUrl (const std::string &url, const Maptarget &ci) |
Mapping & | vMapUrl (const std::string &vhost, const std::string &url, const Maptarget &ci) |
void | setAppName (const std::string &appname_) |
| Set the app name.
|
const std::string & | getAppName () const |
void | setAccessLog (const std::string &accesslog) |
Main application class for stand alone webapplication.
This is the class to use to run a webapplication as a stand alone application. Using this a application runs itself as a webserver instead of using a tntnet application server.
To create a application you need to: instantiate a Tntnet class call listen and/or sslListen for each ip address to listen on set up your url mappings using mapUrl or vMapUrl call run()
void tnt::Tntnet::setAppName |
( |
const std::string & |
appname_ | ) |
|
|
inline |
Set the app name.
The app name is used for the session cookie name if the webapplication is linked directly to a stand alone application. The name of the session cookie is then "tntnet." plus the library name of the web application. Since there is no library name, if the application is run through the Tntnet application class, this application name is used instead.
Setting the application explicitely reduces potential conflicts if multiple tntnet application servers are run on the same host on different ports.