• Post Reply Bookmark Topic Watch Topic
  • New Topic

IO blocking and deadlock  RSS feed

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose I have a client server situation where the client has connected to the server and it is not doing anything for a lot of time and so that thread is blocked. how do we handle that?
 
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set socket timeouts (SO_TIMEOUT), use a reaper thread to close() the socket after a while (dirty, but works), or use java.nio.* non-blocking I/O.
- Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!