Project

General

Profile

Feature #2702

WServer Constructor with Configuration

Added by I. Lazaridis over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
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.

#1

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
#2

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.
#3

Updated by Koen Deforche over 8 years ago

  • Target version changed from 3.3.3 to 3.3.4
#4

Updated by Roel Standaert about 8 years ago

  • Status changed from InProgress to Resolved
#5

Updated by Koen Deforche almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF