UDP client stuck in infinite loop
publicstaticvoid main(String args[])throws Exception
{
BufferedReader inFromUser=new BufferedReader(newInputStreamReader(System.in));
DatagramSocket clientSocket=new DatagramSocket();
InetAddress IPAddress = InetAddress.getLocalHost();
byte[] sendData =newbyte[1024];
byte[] receiveData =newbyte[1024];
String sentence ="";
boolean quit =true;
while(quit ==true);
{
String initiateConntact ="hi there";
sendData= initiateConntact.getBytes();
DatagramPacket sendPacket=new DatagramPacket(sendData, sendData.length, IPAddress, 9876);
clientSocket.send(sendPacket);
DatagramPacket receivePacket=new DatagramPacket(receiveData, receiveData.length);
clientSocket.receive(receivePacket);
String modifiedSentence=new String(receivePacket.getData());
InetAddress getIPFromServer = receivePacket.getAddress();
System.out.println("The server is located at : " + getIPFromServer);
sentence = inFromUser.readLine();
System.out.println("From Server:" + modifiedSentence);
if(sentence.equals("bye"));
{
quit =false;
clientSocket.close();
}
}
}
I am just courious why this pice of code gets stuck in an infinite loop.
(it seems anyway). It doesnt even make it into the while statement. If i replace the while with an if statement, everything works smoothly. Does anyone know what is actually happening here and why?
Thanks for your time.

