• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in reading from the socket  RSS feed

 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
My server application is in c++ and client application is in java.
In my client application,when i am using InputStream.read(byte[] b),it is working fine.But if I use BufferedReader(new InputStreamReader(new InputStream)).readLine(),it is not receiving any data.The client application is keep on waiting and not giving any data.I am not understanding the reason.
Please express your views.

with regards,
ajse
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BufferedReader expects lines to terminate with the platform line terminator (i.e. "\r\n" in Windows, "\n" on Unix, "\r" on Mac). If your server is not sending the correct character, your Reader will not see the end-of-line.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!