QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
-
@CP71 I dont know if this is dangerous or not, but it is easy to change, I think. So I will change it later to pass a QByteArray and not a QByteArray pointer. Related to pendingConnection, I don know if this is necessary or not. I am just going to have a few connection. I proved ths code with three clients and I didnt have troubles. With the exception that I cant send message to the serialport, but is a problem that dont depend of the number of connections. However I saw that the trouble is that the socket dont emit the signal readyRead in the socket of the server when I receive a message from a client.
-
@Dooham
Ok,
When we have some problems we say, “the computer has always reason”, well almost always.
I’m joking ;)I already done a TCP Server but I took another road and I hadn't got special problems, so now I haven’t ideas. :(
If I can, I suggest you to solve one problem at a time, I would start at the end, as per QtcpSocket, to try to understand why readyRead seems not working I should check the following checks:
- Check with Wireshark or other tools if TCP packets arrive to your device
- Check by debug text info about QTcpSocket that you have created (e.g. IP of the client)
Then climb up to TcpServer.
Sorry
-
@CP71 Dont worry, you are helpful. I will tried to find the trouble, I know that must be in my Code of the server, because in the first Code that I published in this thread I could do It. And in a simpler Code for just one connection server-client It also worked.