I was reading the documentation about TCPServer and have two small questions:
The first parameter is:
The documentation parameter for this parameter is:
The server takes ownership of the TCPServerConnectionFactory and deletes it when it's no longer needed.
My question is:
TCPServerConnectionFactory::Ptr is actually Poco::SharedPtr. This takes ownership of the pointer. So when we pass it to the constructor of TCPServer is it actually taking ownership away from the SharedPtr (if so this implies that the parameter should only have a reference count of one (otherwise we are going to get a double delete)) or is it accepting shared ownership (In which case I think the documentation should be made clearer).
Also why not use the equivalent of the std::auto_ptr<> as this would imply transfer of ownership.
When the stop() method is called, the queued ones are just dropped, but does the calling thread suspend until all currently executing connections finish? Or is there another technique to make sure that all executing connections (TCPServerConnection) finish? Otherwise I can see problems with the timing of the destruction of the TCPServerConnectionFactory and the TCPServerConnection(s) that it has created.