Hello guys,
im too newbie to network multiplayer games but i’ve decided to try UDP for testing purposes,
in first intance i want to make a lobby but i want to ask you if my structure is enought:
CLIENT:
gameloop
{
update(); -> receive and send datagram packets in the update method, but i think this will block the thread
render();
}
i must spawn another thread inside UPDATE method, noly for receive data of the server?
SERVER
gameloop
{
update(); -> send and receive data of all clientes
render();
}
or i must spawn a separate Thread, for incoming packets?
ANOTHER QUESTIONS:
how can attach many clients in the server: when a datagram is received i can check the inet address and store this address in a list or array?
can i process the receive and send data in the same thread?
NOTE: this is raw JAVA i want to know the functionality.
thanks in advance.