Quote Originally Posted by Crashz83 View Post
Yes i need to use a thread because the frequency of data's reception is important, otherwise it would block my application.
Ok, I was just checking that you had implemented it without threads first and only start using threads as a last resort.

Quote Originally Posted by Crashz83 View Post
I modified my code, but there is something I do not understand...

" - be aware that your slots are currently executed in the main thread, so do not access "socket" in them " : effectively, i added
Qt Code:
  1. qDebug() << this->thread();
To copy to clipboard, switch view to plain text mode 
and my slot run in the main thread. But, how I can retrieve data before the error, how can I access the socket?
Well, you should not access the socket from two threads. So it would make most sense to handle the signals of the socket in the same thread as the socket.
Either by having the receiver on the same thread or by forcing a direct call using Qt::DirectConnection as the connection type.

Currently you have the receiver on the main thread and are using the default connection type (Qt::AutoConnection) which results in the behavior of Qt::QueuedConnection (emitter thread and receiver owner thread different).

Cheers,
_