When loading an object from the server, it gives this error:
Unable to read data from an open socket. java.io.EOFException.
In this case, the download itself occurs, but then the server stops working. If I write objects to the server, everything is in order.
Tell me, please, how it is necessary to perform the input / output. threads so that the server continues to expect further requests.
while (true) { socket = this.serverSocket.accept(); OutputStream oStream = socket.getOutputStream(); ObjectOutputStream ouStream = new ObjectOutputStream(oStream); ouStream.writeObject(objects); InputStream iStream = socket.getInputStream(); ObjectInputStream inStream = new ObjectInputStream(iStream); Object tmp = inStream.readObject(); if (tmp!=null) objects = (ArrayList<Shape>)tmp; inStream.close(); ouStream.close(); socket.close(); Thread.sleep(1000); }