Currently I write an server application using [Poco::Util::ServerApplication]. And I have a X class that need to construct one time at first for using later. So I construct it in initialize() function of application. The problem is : I need to use X::myFunction() in handleRequest function of MyRequestHandler : public HTTPRequestHandler to return the client.
I did following this way but it's not work;
This is MyRequestHandler:
- Code: Select all
# include "MyServer.h"
void MyRequestHandler::handleRequest(HTTPServerRrequest &request_, HTTPServerResponse &response_)
{
...
MyServer server = MyServer::instance();
server.X.myFunction();
...
}
Is there any way to solve this problem ?
Thanks so much for any helps





