Hello,
I am attempting to run an httpserver from an application that links to ROOT, but the server doesn’t seem to work correctly out of the box.
In the ROOT terminal it is enough to run auto server = new THttpServer();
in order to start the server, it will run in the background.
In my application I am running the server as follows:
#include <THttpServer.h>
#include <unistd.h>
int main() {
auto server = new THttpServer();
unsigned int microsecond = 1000000;
usleep(30 * microsecond); // sleeps for 3 second
}
I need to add some sleep afterwards because otherwise it would exit after creating the server. When I run the server like this, It doesn’t respond to http requests, they remain stuck on “pending”, so the server is running but not working correctly. I have also tried to start the server in its own thread with std::thread
with the same results.