Feature #2702
WServer Constructor with Configuration
Start date:
02/23/2014
Due date:
% Done:
0%
Estimated time:
Description
Current:
WServer server(argv[0]); server.setServerConfiguration(argc, argv, WTHTTPD_CONFIG_FILE);
This can be simplified to:
WServer server(argc, argv, WTHTTPD_CONFIG_FILE);
by simply adding the additional constructor.
Compatibility
The additional constructor would not break any existent code.
Updated by Koen Deforche over 8 years ago
- Status changed from New to InProgress
- Assignee set to Roel Standaert
- Target version set to 3.3.3
Updated by I. Lazaridis over 8 years ago
A small update:
The addition for WRun would be:
int WRun(int argc, char* argv[], ApplicationCreator createApplication, const std::string& serverConfigurationFile = WTHTTP_CONFIGURATION) { [...] // WTHTTP_CONFIGURATION is e.g. "/etc/wt/wthttpd" server.setServerConfiguration(argc, argv, serverConfigurationFile );
in analogy, the new constructor for WServer should become:
WServer server(int argc, char* argv[], ApplicationCreator createApplication, const std::string& serverConfigurationFile = WTHTTP_CONFIGURATION)
Usage:
WRun(argc, argv, createApp, "/my/wthttpd"); WServer server(argc, argv, createApp, "my/wthttp"); [...] (do things with server) server.run(); where "my/wthttpd" is optional.