• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server gets crashed and throws IOException

 
Steiphan Jason
Greenhorn
Posts: 8
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created very simple multi-threaded java socket chat program, and that works fine when they are chatting and new clients join to the program.But as soon as one client gets terminated or closed, the entire server fails with all other active clients in the chat. Could you guys give me an idea to solve this, please friends.


 
Henry Wong
author
Marshal
Pie
Posts: 21417
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steiphan Jason wrote:I have created very simple multi-threaded java socket chat program, and that works fine when they are chatting and new clients join to the program.But as soon as one client gets terminated or closed, the entire server fails with all other active clients in the chat. Could you guys give me an idea to solve this, please friends.


The process of closing one client, includes terminating the buffered reader, which is wrapped around standard input. This means that when a client is closed, standard input is closed. And when standard input is closed, then you can't type anything for that client, or any of the other clients.

Henry
 
Steiphan Jason
Greenhorn
Posts: 8
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Henry Wong! Now I solved the problem. Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic