Unsolved QTcpSocket, execution halts why and what does it mean?
-
@SPlatten said in QTcpSocket, execution halts why and what does it mean?:
the examples I've found on QThread do not include how to NOT block the event loop
Here, this wont block:
- https://www.bogotobogo.com/Qt/Qt5_QTcpSocket.php (your 2nd linked example)
This guy (https://stackoverflow.com/questions/37167927/proper-way-to-run-managable-background-thread-with-qthread) has made a similar mistake.
You want to connect once and then let the event loop and your signals do the rest. -
Funny - this discussion was already done more than 3 months ago already: https://forum.qt.io/topic/120700/receiving-data-from-qtcpsocket/30
-
@Christian-Ehrlicher , is it any surprise I'm confused, in that thread you pointed me to the Fortune client and server examples, which I have been following then there is conflicting advice that comes back form this forum when I implement a solution that I'm having problems with.
Add to this the what appears to be flaky Qt Creator with updates that seem to send me backwards. I feel I'm loosing the plot.
-
The old thread told you to use signals and slots and not the waitFor functions and now we're at the exactly same place.
-
@Christian-Ehrlicher , well obviously I have mental memory issues.
-
@Christian-Ehrlicher , the examples that ship with Qt 5.15.2 include:
blockingfortuneclient
threadedfortuneserverOn looking at both, these are the sources I used to base my work on. My server is slightly different in that the clients are intended to stay connected after establishing a connection.
I will compare the client source with my own.
-
From my pov you don't need threads at all but this is not what you want to hear for whatever reason - you rather work on simple stuff like a QTcpSocket for months.
-
@Christian-Ehrlicher , one day I will be ready to share what I'm working on, which isn't now.
-
@SPlatten said in QTcpSocket, execution halts why and what does it mean?:
one day I will be ready to share what I'm working on, which isn't now.
This sentence sounds strange to me.
I think you misunderstanding some comments/replies you received here.
My personal goal is to help other developers to solve problem they have will creating software with Qt, like I received help from other to solve/understand errors in my software.On the other side, this also helps me to get a better overview of Qt Framework and continue to learn.
-
@KroMignon , sorry, some of the comments, not yours I find a little offensive.
-
@KroMignon said in QTcpSocket, execution halts why and what does it mean?:
My personal goal is to help other developers to solve problem they have will creating software with Qt, like I received help from other to solve/understand errors in my software.
On the other side, this also helps me to get a better overview of Qt Framework and continue to learn.This is exactly why I'm here :D