Qt asynchronous sockets problem
Hey everybody,
I'm trying to write a simple, four-player card game to play over the network using the QT4 toolkit. I've set up a protocol (client/server) such that I always know when I must do sending and when I must do recieving. Unfortunatly using the sockets system is causing me epic headaches! The problem is, I don't want to block the GUI by using QTcpSocket::waitForReadyRead(). What I had in mind was using blocking I/O in a thread whenever it was necessary and catching the thread's terminate signal in my main loop...but then I have no way of knowing which socket (player) I just finished sending data to! Idealy, i'd like to do something like this... (in the server) Code:
class MyIOThread : public QThread Thanks |
All times are GMT -5. The time now is 06:29 PM. |