I am currently working on a multiplayer 2d top down racer and got a question about networking.
At the moment when a client wants the new postion of the players it sends an udp packet and with the packets inetaddress and port the server can send the position to the client.
Now i thought this is really inconvenient so tried saving the port and inetaddress of each player in a HashMap and start a new Thread on the server where i send the movement updates to every client whos in the map every 30 ms or so ...... unfortunately in this way the clients did not receive the packets.
So my question is: How can my clients receive udp packets from the server without sending an udp-packet before receiving?
Hope you guys understand my problem and i am looking forward to your answers!!!