I am running the Fortune Server and Fortune Client examples. Unfortunately, both programs start up fine, but they do not make a TCP socket connection. The server says it is listening, and 'netstat' confirms this. After the client calls 'connectToHost', the socket is supposedly open. Here is the code that I use to confirm that:
getFortuneButton->setEnabled(false);
blockSize = 0;
tcpSocket->abort();
tcpSocket->connectToHost(hostLineEdit->text(),
portLineEdit->text().toInt());
if (tcpSocket->isOpen ())
statusLabel->setText ("It is open.");
else
statusLabel->setText ("It is NOT open.");
getFortuneButton->setEnabled(false);
blockSize = 0;
tcpSocket->abort();
tcpSocket->connectToHost(hostLineEdit->text(),
portLineEdit->text().toInt());
if (tcpSocket->isOpen ())
statusLabel->setText ("It is open.");
else
statusLabel->setText ("It is NOT open.");
To copy to clipboard, switch view to plain text mode
I even tried to connect the client to another (non-QT) server application I have and the QT client does not make the connection.
Does anyone know of any problems with the Fortune Server, Fortune Client examples?
Thanks,
DP
Bookmarks