package students; import com.google.gson.Gson; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; public class University { public static void main(String argv[]) throws Exception { ServerSocket welcomeSocket = new ServerSocket(6789); while(true) { Socket connectionSocket = welcomeSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); Gson gson = new Gson(); String fromClient = inFromClient.readLine(); Student student = gson.fromJson(fromClient, Student.class); System.out.println(fromClient); } } }