Client blocks at reading from stream
I will show only some important fragments of program
Some code in client:
The problem is that when client reads ArrayList<Player> object from stream, it blocks at readInt() method, despite server sent int after sending object. Then finally it passes readInt() after sending some data to server which is in some method called when some event occurs.
msgType = clientApp.reader.readInt();
case 1: ... break;
clientApp.gamePanel.players = (ArrayList<Player>)clientApp.reader.readObject();
clientApp.gamePanel.myId = clientApp.reader.readInt();
ok, I think problem is solved. I put client.out.flush(); after writing last int and it works properly. I don't understand what does it change because I didn't use this method before while writing to the stream and everythink worked fine.