It took some time because Wireshark cannot catch on localhost and I had to setup another PC to test it. But Now I see that response is sent back, so socket should have this data.
@nix: Unfortunately this project is on VS2003 and I don't see qDebug() output and errors like you. I'll try to create socket diret in run(). In this case such error shouldn't occur.
Added after 10 minutes:

Originally Posted by
nix
If it would work without QThread event loop, I would be happy, but it doesn't. Threrfore I've tried it with QThread. May be it's also wrong.
I already read this article, but I don't move thread to itself. I move socket to this new thread and this shold be correct. But I'll try it without QThread subclassing. May be it differs...
Added after 6 minutes:
ClientSocket::ClientSocket()
:m_isRunning(false)
{
connect(m_socket, SIGNAL(readyRead()), this, SLOT(test()));
m_socket->moveToThread(t);
t->start();
ClientSocket::ClientSocket()
:m_isRunning(false)
,m_socket(new QTcpSocket())
{
QThread* t=new QThread();
connect(m_socket, SIGNAL(readyRead()), this, SLOT(test()));
m_socket->moveToThread(t);
t->start();
To copy to clipboard, switch view to plain text mode
This way slot also doesn't get called. And without subclassing QThread I cannot start QThread's event loop because exec() is protected.
Bookmarks