• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Server gets crashed and throws IOException

 
Greenhorn
Posts: 8
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
author
Posts: 23899
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much Henry Wong! Now I solved the problem. Thank you
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic