probine
22nd December 2006, 14:31
I have a QTcpSocket that connects to a server.
I instantiate the tcpSocket, and connectToHost.
Everything is fine, then the "connected" signal should be emitted, but it is not.
tcpSocket->connectToHost(QHostAddress("localhost"), quint16(35310));
connect(tcpSocket, SIGNAL(connected()), this, SLOT(connectedToServer()));
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(read()));
connect(tcpSocket, SIGNAL(disconnected()), this, SLOT(disconnected()));
What is wrong ?
Why the "connected" signal is emitted when I close the window ?
I instantiate the tcpSocket, and connectToHost.
Everything is fine, then the "connected" signal should be emitted, but it is not.
tcpSocket->connectToHost(QHostAddress("localhost"), quint16(35310));
connect(tcpSocket, SIGNAL(connected()), this, SLOT(connectedToServer()));
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(read()));
connect(tcpSocket, SIGNAL(disconnected()), this, SLOT(disconnected()));
What is wrong ?
Why the "connected" signal is emitted when I close the window ?