I have created a simple little game, and I wish to make it play over network. The datatransfer is simple, they take turn sending 4 ints (the moves) to each other.
How do you write code for this?
I have never written network code before.
I have created a simple little game, and I wish to make it play over network. The datatransfer is simple, they take turn sending 4 ints (the moves) to each other.
How do you write code for this?
I have never written network code before.
Should both clients have a QTcpServer running and let the other client connect to them? Or should only one be runnig as server?
It doesn't matter. For simplicity make only one of them a server.
I'm trying to work with the
http://doc.trolltech.com/4.3/network-fortuneclient.html
example, but how can I let the client send data back to the server?
Update: I think I got it! I just send back data and receive it with the socket that was given by the nextPending-something .
It worked!
Last edited by Morea; 29th May 2007 at 20:34.
Bookmarks