Note: If you want to handle an incoming connection as a new QTcpSocket object in another thread you have to pass the socketDescriptor to the other thread and create the QTcpSocket object there and use its setSocketDescriptor() method.
This note is cited from the QTcpServer page. Following the rule given in the above note, I could not find a way to check the incoming connection for a valid peerAdress before creation of the new thread.
I do not like the idea to create a new thread, have it create a socket inside itself with the given socketDescriptor, just to find out that the whole setup has to vanish (i.e. to be deleted) because the peerAdress turned out to be invalid.
The peerAdress can be obtained from the socket only after the latter had been created inside the thread.
Any hint how to deal with this issue? Thanks in advance.
↧