Module Netplex_config


module Netplex_config: sig .. end
Read the configuration file

exception Config_error of string
val read_config_file : string -> Netplex_types.config_file
val read_netplex_config : Netplex_types.parallelization_type ->
Netplex_types.logger_factory list ->
Netplex_types.workload_manager_factory list ->
Netplex_types.processor_factory list ->
Netplex_types.config_file -> Netplex_types.netplex_config
Reads a configuration file like:

 netplex {
      controller {
          ...
          logging {
          ...
          };
      };
      service {
          name = "name_of_service";
          protocol {
              name = "name_of_protocol";
              lstn_backlog = <n>;
              lstn_reuseaddr = <bool>;
              so_keepalive = <bool>;
              address {
                  type = "local";
                  path = "socketname";
              };
              address {
                  type = "internet";
                  bind = "bind_address:port";
              };
              ...
          };
          processor {
              type = "type_of_processor";
              ...
          };
          workload_manager {
              type = "type_of_manager";
              ...
          };
      }
   }
 

The controller section is explained in Netplex_controller.

The logging section is explained in Netplex_log.

The service section may also contain two parameters user and group. They instruct the service container to drop root privileges and to become the configured user and group. Note that this is only possible in multi-processing mode.

Address types:

More documentation: See Example - A Simple Web Server for a complete example of a config file. See Creating Sockets for explanations how to specify sockets in the config file.