hi
I am trying to read from a tcp stream a message sent from client. Thing is after reading the last line, my readline function is not returning null and i am not able to debug why, as control point is lost. In short, after last line read, readLine function should return null, but i am not getting any thing as such.
this is what my code looks like
StringBuffer sipBuffer = null;
String lineRead = null;
readIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));
try {
sipBuffer = new StringBuffer();
while ((lineRead = readIn.readLine()) != null) {
sipBuffer.append(lineRead);
sipBuffer.append("\n");
}
} catch (Exception ex) {
sipConsole.addText("Error in message: \n");
sipConsole.addText(ex.getMessage());
return;
}
format of message is
String inviteReq = "INVITE sip:" + destIP + "@sip.umsy.edu SIP/2.0" + "\n"
+ "From: \"" + myName + "\" <sip:" + myIP + "@sip.umsy.edu>" + "\n"
+ "To: <sip:" + destIP + "@sip.umsy.edu>" + "\n"
+ "Allow: INVITE, ACK, BYE" + "\r\n";