Hi Guys

task is to produce a simple client/server guessing game app. I cant seem to get it to respond after the first guess. So it's getting to the part where it sends the next guess back to the server, but just stops at that point. Probably something simple but after any hints - code below

Java Code:
public class GuessingGame 
{
	//variables 
	private int goal;
	private boolean correct;

	//constructor
	public GuessingGame()
	{
		goal = (int) (Math.random() * 999 + 1);
		correct = false;
	}
	
	public int getGoal()
	{
		return goal;
	}
	
	
	
	public boolean getCorrect()
	{
		return correct;
	}
	
	public String guess(int guess)
	{
		if(guess == goal)
		{
			correct = true;
			return "Congratulations, you got it correct!";
		}
		else if(guess > goal)
		{
			return "Too high I'm affraid, have another pop!";
		}
		else return "Too low, try a bigger guess!";
	}
}
Java Code:
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;


public class GuessServer 
{
	public static void main(String[] args) throws IOException
	{
		GuessingGame game = new GuessingGame();
		ServerSocket socket = null;
		Socket client = null;
		String result;
		boolean correct = false;
		int attempt;
		try
		{
			socket = new ServerSocket(1234);
		}
		catch(IOException ioe)
		{
			System.err.println(ioe);
			return;
		}
		System.out.println("Server Running");
		client = socket.accept();
		System.out.println("Client Connected");
		DataInputStream in = new DataInputStream(new BufferedInputStream(client.getInputStream()));
		DataOutputStream out = new DataOutputStream(new BufferedOutputStream(client.getOutputStream()));
		while(true)
		{
			attempt = in.readInt();
			result = game.guess(attempt);
			correct = game.getCorrect();
			out.writeUTF(result);
			out.writeBoolean(correct);
			out.flush();
			if(correct == false)
			{
				client = socket.accept();
				attempt = in.readInt();
				result = game.guess(attempt);
				correct = game.getCorrect();
				out.writeUTF(result);
				out.writeBoolean(correct);
				out.flush();
			}
			else 
			{
				client.close();
				socket.close();
			}
			
		}
	}
}
Java Code:
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;


public class GuessClient 
{
	public static void main(String[] args) throws IOException
	{
		System.out.println("Welcome to the Guessing Game. \nPlease Enter a number between 1 and 999 : ");
		Scanner keyboard = new Scanner(System.in);
		int attempt = 0;
		try
		{
			attempt = keyboard.nextInt();
			if(attempt < 1 || attempt > 999)
			{
				System.out.println("Number too large/small, guess between 1 and 999");
				attempt = keyboard.nextInt();
			}
		}
		catch(NumberFormatException nfe)
		{
			System.out.println("Only numbers! Try again");
			attempt = keyboard.nextInt();
		}
		
		try
		{
			Socket server = new Socket("localhost", 1234);
			System.out.println("Connection Established.....");
			
			DataOutputStream out = new DataOutputStream(new BufferedOutputStream(server.getOutputStream()));
			DataInputStream in = new DataInputStream(new BufferedInputStream(server.getInputStream()));
			
			out.writeInt(attempt);
			out.flush();
			System.out.println("Waiting for Server......");
			String result = in.readUTF();
			boolean correct = in.readBoolean();
			System.out.println(result);
			while (!correct)
			{
				attempt = keyboard.nextInt();
				out.writeInt(attempt);
				out.flush();
				System.out.println("Waiting for Server......");
				result = in.readUTF();
				System.out.println(result);
				correct = in.readBoolean();
				
			}
			server.close();
			System.out.println("Game Over. Goodbye");
			System.exit(0);
			
		}
		catch(IOException ioe)
		{
			System.err.println(ioe);
		}
		
		
		
	}
}