File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Server gets crashed and throws  IOException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Server gets crashed and throws  IOException" Watch "Server gets crashed and throws  IOException" New topic
Author

Server gets crashed and throws IOException

Steiphan Jason
Greenhorn

Joined: Jul 04, 2013
Posts: 8

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
Sheriff

Joined: Sep 28, 2004
Posts: 19070
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Steiphan Jason
Greenhorn

Joined: Jul 04, 2013
Posts: 8

Thank you so much Henry Wong! Now I solved the problem. Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server gets crashed and throws IOException