Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

blocking read method  RSS feed

 
ravinder pasula
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I have a typical networking problem, where a clientSocket sends data to a serverSocket. While the client is transmitting a file, and in the middle of it, if client's network fails then at the server end the stream's read method seems to go in infinite loop.
Most craziest part is even after a long time it doesn't seem to throw an exception.
Can anyone help me???

(even though this is a typical networking problem, i somehow feel that there is some problem with the streams, so have put it in streams section)

thanks,
~rkay
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rkay, we try to keep things friendly around here so we ask that everyone use a first name and last name as their displayed name, and that the displayed name is not obviously fake (our naming policy). You can change your displayed name here.
As for your problem. Yes, that sounds unusual. However, I don't think you've given us enough information. How about a small snippet of code?
 
ravinder pasula
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Joe, for hiding my name with rkay.
Here is the code snippet where read method gets blocked.
Here all the out stream part has been removed for simplicity.
Here MAX_BUFFER_SIZE is 8196;
InputStream strm, long dataSize are the inputs to this method:

thanks
~ravinder

[added [code] tags - Jim]
[ March 19, 2006: Message edited by: Jim Yingst ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!