I am making a game which has chat and has moves. Each with its separate port for communication. Here is how the object waits for incoming traffic
while (true) {
Object o = oiStream.readObject();
if(o!=null)
{
blahblahblah = the code here
}
The code works but I am curious what happens if the client sends 2 messages and the second message arrive first? Is objectinputstream handling such things or do I need to ID tag the messages?