This discussion is archived
6 Replies Latest reply: Mar 15, 2011 11:09 AM by jschellSomeoneStoleMyAlias RSS

JAVA IOException uncatched

847247 Newbie
Currently Being Moderated
Hi, I'm using Java.nio channels and when one client was forced to disconnect to my host, my host launch that exception: Se ha forzado la interrupción de una conexión existente por el host remoto
     at Method)
     at Source)
     at Source)
     at Source)
     at Source)

The Code is this:

if (key.isReadable()) {

                                   SocketChannel client = (SocketChannel) key

                                   // Create buffer to read
                                   int BUFFER_SIZE = 2000;
                                   ByteBuffer buffer = ByteBuffer

                                        byte[] aReceivedByteArray = new byte[2000];


                                        catch (IOException e){
                                             System.out.println("I'ts disconnected");

I don't know why the catch statement is not catching that exception.
I've tryed to move the try/catch statements to some other lines, but always the IOexception is lunched.
Can somebody help me how to solve that problem?



P.D. I think I have post in a wrong part of the forum, sorry for that.

Edited by: 844244 on 14/03/2011 10:36


  • Correct Answers - 10 points
  • Helpful Answers - 5 points