Page tree

We have introduced an experimental DOOCS server class. The motivations behind this are the following:

  • Give the server programmer more control over its own main() if desired
  • Provide an alternative way of customizing server behavior than providing linker objects for functions such as eq_cancel(), eq_init_epilog(), interrupt_usr1_prolog() etc.
  • Maintain full backwards compatibility with existing DOOCS servers

Starting with DOOCS 20.6.0, a DOOCS server can be written like this:

#include <doocs/Server.h>

void print_message() override
    printtostderr(__func__, "Server initialization");

int main(int argc, char *argv[])
    doocs::Server server("test_server"); // sets object_name

// Register an EqFct that provides a public constexpr static int code and a default constructor

// Register an EqFct that needs additional parameters
[]() { return new EqFctDummy2(argc, argv) });

// Call print_message at the start of the post init phase
server.set_post_init_epilog(print_message);, argv);
  • No labels