MaServer Struct Reference
Inheritance diagram for MaServer:
List of all members.
Detailed DescriptionHTTP server possibly listening on multiple ports.
An application may have any number of HTTP servers, each managed by an instance of the Server class. Typically there will be only one server in an application. There may be multiple virtual hosts and one default host for each server class. A server will typically be configured by calling the configure method for each server which parses a file to define the server and virtual host configuration.
- Stability classification:
- Evolving.
Constructor & Destructor Documentation
MaServer::MaServer |
( |
MaHttp *
|
hs, |
|
|
char * |
name, |
|
|
char * |
root = 0, |
|
|
char * |
ipAddr = 0, |
|
|
int |
port = 0 |
|
) |
|
|
|
- Synopsis:
- Constructor to create a HTTP server.
- Overview:
- Creates a logical HTTP server that may consist of multiple virtual servers.
- Parameters:
-
hs |
Pointer to the MaHttp object created by maCreateHttp.
|
name |
Descriptive name to give to the server. |
root |
Top level path of the directory containing the server. |
ipAddr |
IP address to listen to |
port |
Port number to listen to |
- Stability classification:
- Evolving.
- Library:
- libappWeb
- See also:
-
~MaServer, configure
|
Member Function Documentation
int MaServer::configure |
( |
char * |
configFile |
) |
|
|
|
- Synopsis:
- configure the entire server from a configuration file.
- Overview:
- Servers are configured via an Apache-style configuration file. A server may listen on multiple ports and may contain multiple virtual hosts.
- Parameters:
-
configFile |
Path of the configuration file. |
- Returns:
- Returns zero if successful, otherwise a negative MPR error code.
- Configure options:
- Requires BLD_FEATURE_CONFIG_PARSE.
|
int MaServer::getLine |
( |
|
) |
[inline] |
|
|
- Synopsis:
- Return the current configuration file line number
- Overview:
- If a error is encountered when parsing the configuration file, getLine will return the current line number for error reporting purposes.
- Returns:
- The current line number (origin 1).
- Stability classification:
- Evolving.
- Library:
- libappWeb
- See also:
-
configure
|
int MaServer::loadModule |
( |
char * |
name, |
|
|
char * |
libname = 0 |
|
) |
|
|
|
- Synopsis:
- Load an AppWeb module
- Overview:
- This routine loads the given module. the designated the AppWeb configuration file.
- Parameters:
-
name |
The module name is the pure module prefix. Eg. "cgi". |
libname |
The libname should not include an extension. Eg. "libcgiModule". |
- Returns:
- Returns zero if successful
- Stability classification:
- Evolving.
- Library:
- libappWeb
- See also:
- addHandler
|
MaHost * MaServer::newHost
|
( |
char * |
docRoot, |
|
|
char * |
ipSpec = 0 |
|
) |
|
|
|
- Synopsis:
- Create a new host
- Overview:
- Create a new host for this server
- Parameters:
-
docRoot |
Directory containing web content to be served |
ipSpec |
IP:PORT address to use as a ServerName for redirections |
- Returns:
- Returns zero if successful
- Stability classification:
- Evolving.
- Library:
- libappWeb
- See also:
-
configure
|
int MaServer::saveConfig |
( |
char * |
configFile |
) |
|
|
|
- Synopsis:
- Save the current configuration to the named file
- Overview:
- This routine will save the run-time configuration to the designated the AppWeb configuration file.
- Parameters:
-
configFile |
Name of the file to save to |
- Returns:
- Returns zero if successful
- Stability classification:
- Evolving.
- Library:
- libappWeb
- Configure options:
- Requires BLD_FEATURE_CONFIG_SAVE.
- See also:
-
configure
|
|
- Synopsis:
- Start the server.
- Overview:
- Call to start all hosts within the server.
- Returns:
- Returns zero if successful, otherwise return a negative MPR error code.
|
|
- Synopsis:
- Stop the server.
- Overview:
- Call to stop all hosts within the server.
- Returns:
- Returns zero if successful, otherwise return a negative MPR error code.
|
The documentation for this struct was generated from the following files:
|
|