Fortune Server/Client Example does not work remote
-
Hello,
I want to control a GUI running on a Raspberry PI remotely from a computer connected via local ethernet link.
I found the fortune server / fortune client examples from the Qt Network module.This example is running nice as long as I'm running the server and the client on the same host (Laptop (Qt 5.7.1 amd64 GNU/Linux) or Raspbian (Qt 5.3.2 armhf Linux)). If I try to connect from one host to the other, I receive no fortune. If the IP or the port is invalid, I receive a error. If both are valid there is just no fortune.
Is there a bug, or do I have to adapt the example for my purpose?
Is this example a good starting point for implementing a fast and simple signaling between two local linked hosts?
Thanks for your suggestions.
-
-
@vishnu
There should no firewalls be running. On my Laptop no firewall is set up and also on the Raspberry PI there is no firewall set up by default.
I'm connecting to the Raspberry via VNC, so there is a link for sure.
So I can't imaging that packets could be blocked. Nevertheless I will try to investigate wireshark. -
Hmm,
as soon I send a single first request, the data packages are going back and forth and fortunes are send (monitoring at the server host). As soon I'm closing the server, I get some errors and the client takes note and shows a connection error.
Therefore I assume, that the client does not handle the received data correctly. -
which means there is a connection problem.
Try to bebug it.-
after tcpSocket->connectToHost(hostCombo->currentText(),
portLineEdit->text().toInt())
check if the connection is success or not -
check emit readyRead() signal is emitted or not by connecting it to a slot.
-
-
Hi vishnu,
I investigated the issue: the examples from Qt 5.3.2 and Qt 5.7.1 are not compatible. If I run the 5.3.2 example on both hosts, it works. I have not checked with the 5.7.1 example, as it relies on new calls.
@qmmj
Hi
Purely speculation but
If you mix Qt 5.3 and 5.7
Maybe its related to
http://doc.qt.io/qt-5/qdatastream.html#versioning
Didnt check if qdatastream is involved in the fortune examples :) -
@mrjj:
in each casessetVersion(QDataStream::Qt_4_0);
is called. This is not the difference. I realized with wireshark, that there is a different amount of data bytes before the characters are starting (4 resp. 6 bytes), but I have not investigated this further. -
@mrjj:
in each casessetVersion(QDataStream::Qt_4_0);
is called. This is not the difference. I realized with wireshark, that there is a different amount of data bytes before the characters are starting (4 resp. 6 bytes), but I have not investigated this further.