This is my first time using a Socket client Server system. I'm running into an error with the server side of my system and I do not know where it is coming from. My client is running fine and closing but my server this is the function for
public void run() throws Exception
{
ServerSocket SRVSCK = new ServerSocket(444);
Socket Sock = SRVSCK.accept();
String Message="";
InputStreamReader IR = new InputStreamReader(Sock.getInputStream());
BufferedReader BR = new BufferedReader(IR);
Message = BR.readLine();
while(Message!="exit"){
System.out.println(Message);
Message = BR.readLine();
}
SRVSCK.close();
Sock.close();
System.out.println("here");
}
But this is the error I'm getting. It doesn't get out the while loop. I've tried breaking out the loop early based on the value of Message but it doesn't. And I can't figure out why. I've checked the thread and nothing seems to be the same. If it matters the information from the client is coming from a file.
while(!Message.equalsIgnoreCase("exit"))instead.