c++ - Restart Poco HTTP Server -
i have implemented http server using poco-libraries. runs rest service , works fine.
the http server runs daemon on linux system.
now want implement functionality rest service restarts http server daemon itself.
i use popen call shell command restart daemon. daemon restarts , can see via netstat -plten , ps -aux server gets new pid , listening on port 80. but not handle incoming http requests.
if type shell command directly terminal, daemon restarts, gets new pid , handles incoming http requests.
what wrong?
edit
i have tried calling shell command system(command); , std::thread(std::system,command).detach(); result same.
i found solution.
when creating poco::net::httpserver, create poco::net::serversocket go along it. need close socket before restarting daemon.
Comments
Post a Comment