Hello all
I'm currently trying to get a network application running. 2 instances from the same machine, one acting as Server, the other as Client. The Client continuously sends HashMaps of <String,Integer> type which have constantly changing values to the Server. It does this by an 'ObjectOutputStream(Socket.getOutputStream())', where it writes the object with writeObject(HashMap);, then flush() it. So far so good, right??
On the server end, it loops over and over collecting objects from an ObjectInputStream using readObject().
The problem is, it never, ever receives any updated HashMaps. It gets the first HashMap sent, and that's it. I can confirm this with System.out.println(readObject()); I cannot for the life of my understand why this is the case. Does anyone else?
I'm currently trying to get a network application running. 2 instances from the same machine, one acting as Server, the other as Client. The Client continuously sends HashMaps of <String,Integer> type which have constantly changing values to the Server. It does this by an 'ObjectOutputStream(Socket.getOutputStream())', where it writes the object with writeObject(HashMap);, then flush() it. So far so good, right??
On the server end, it loops over and over collecting objects from an ObjectInputStream using readObject().
The problem is, it never, ever receives any updated HashMaps. It gets the first HashMap sent, and that's it. I can confirm this with System.out.println(readObject()); I cannot for the life of my understand why this is the case. Does anyone else?