Java application simulating communication between server and client (sockets, threads, serialization)