This is a baaaad idea. The CIncomingConnection / CWebSock / CHTTPSock / CClient / whatever could live longer than the CListener that it gets passed as an argument. If the listener is deleted while a CWebSock is still waiting for a request to come in, we get a use after free.

If you want to work around this, you would need to make the listeners reference-counted. E.g. by moving the ownership to CListener from CZNC to a CSmartPtr.