Connection loses before/while readLine(); : Whenever i try to recieve an answer from my Server, the connection closes. This happens at the `rcvdId = inFromServer.readLine();` from the Client. The server does recieve the variables I am sending. `serialToNucleo.nucleoAnswer` also contains a string .I know the code wont fully work yet as I am only sending 1 variable but I am working on that.

Any help would be apreciated. 
Thx


Client
`try {

            Socket skt = new Socket("192.168.1.9" , 6789);

            BufferedReader inFromServer =
                    new BufferedReader(new InputStreamReader(skt.getInputStream()));
            PrintWriter out = new PrintWriter(skt.getOutputStream(), true);
            System.out.print("Sending string: '" + vraagTemp + " and " + vraagId+"'\n");
            out.print(vraagTemp + "\n");
            out.print(vraagId + "\n");
            out.close();
            rcvdId = inFromServer.readLine();
            rcvdTemp = inFromServer.readLine();

            WriteToDb writeToDb = new WriteToDb();
            writeToDb.SendDataToDb(rcvdId,rcvdTemp);

            skt.close();
        }`

Server: `while (true) {
            Socket skt = serverSocket.accept();
            BufferedReader inFromClient =
                    new BufferedReader(new InputStreamReader(skt.getInputStream()));
            PrintWriter out = new PrintWriter(skt.getOutputStream(), true);
            ontvServer = inFromClient.readLine();
            id = inFromClient.readLine();
            System.out.println("Received: " + ontvServer);
            if (id != null && ontvServer != null)
            {
                serialToNucleo.SetupComm(ontvServer, id);
            }
            else
            {
                Thread.sleep(100);
            }
            if (serialToNucleo.nucleoAnswer!= null) {
                out.print(serialToNucleo.nucleoAnswer + "\n");
                id = null;
                ontvServer = null;
            }
            else
            {
                Thread.sleep(100);
            }`