it is good practice to connect the finished
signal of a thread to its own deleteLater
slot so it can clean itself up, but this may cause dangling pointers if you keep a pointer to the QThread
QTcpServer.listen()
will return immediately it just activates the port
when listening a TCPServer will emit a newConnection()
signal each time a new connection is initiated by a client after which you can retrieve it with nextPendingConnection