intensifi
10th February 2006, 07:20
Does anyone have any experience with this?
The QT 4.1 examples do not make use of this approach, but the Qthread class documentation shows pseudo code that does. I am drawn to this approach because I normally have my client in request/reply mode with a server, but sometimes the server sends data asynchronously on the socket.
Specifically I'd like to see an eaxmple that has the main run() function use QThread:exec() and have member functions for other threads to call to post requests to the server and have the thread receive messages from the server (QTCPSocket signals) , read tyhem correctly, parse them and emit signals for all server messages to anyone that might be listening.
As a side note, how about protecting the socket read and write functions separately as they are really two distinct pipes.
thanks in advance!
The QT 4.1 examples do not make use of this approach, but the Qthread class documentation shows pseudo code that does. I am drawn to this approach because I normally have my client in request/reply mode with a server, but sometimes the server sends data asynchronously on the socket.
Specifically I'd like to see an eaxmple that has the main run() function use QThread:exec() and have member functions for other threads to call to post requests to the server and have the thread receive messages from the server (QTCPSocket signals) , read tyhem correctly, parse them and emit signals for all server messages to anyone that might be listening.
As a side note, how about protecting the socket read and write functions separately as they are really two distinct pipes.
thanks in advance!