Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How do I use a UDP socket to LAN a game?
Aubrey12 last edited by
I have created an air hockey game as an assignment, but now have received a new assignment to take that game and LAN it between two computers.
We are allowed to make the two IP adresses fixed adresses.
Can anyone please push me into the right direction?
soroush last edited by
I suggest use TCP instead. UDP is unreliable.
koahnig last edited by
As soroush already suggested TCP is probably better than UDP. Especially if you have dedicated connections. TCP makes sure that the information is being received.
UDP is for broadcasting from one server to a number of clients, but it does not care that the info is really received.
If you are looking for a start, there are "the network examples.":https://qt-project.org/doc/qt-4.8/examples-network.html
A good start are the "fortune server":https://qt-project.org/doc/qt-4.8/network-fortuneserver.html and the "fortune client":https://qt-project.org/doc/qt-4.8/network-fortuneclient.html examples.