I have very simple TCP socket listener. I want to stop receiving data when the character is null or #.
while ((line = in.readLine()) != null && !line.equals("#")){
tcpData = tcpData + line;
}
server.close();
is not closing the socket as code flows. The socket closed only when I am closing from Hyperterminal. What I missed ?
readLineunless you want to read a line.