I try to add TCPServer and family into GLUEscript. I have the problem that when the script ends (which runs in the main thread), all child threads ends too. I'm not familiar with threading in C/C++, so I'm looking for the best way to let the main thread wait for all its child threads to end.
You'll probably need a Poco::Event that you wait() for in you main thread (before joining the threads from the pool). When it's time to stop the TCPServer, set() the event object from another thread and the call to wait() will return. Many POCO-based server applications call Poco::Util::Application::waitForTerminationRequest() after setting up the TCPServer (or HTTPServer, etc.). waitForTerminationRequest() will block until the user enters CTRL-C or kills the process. You want something similar for your scripts.