6 Replies Latest reply on Mar 15, 2011 6:09 PM by jschellSomeoneStoleMyAlias

    JAVA IOException uncatched

      Hi, I'm using Java.nio channels and when one client was forced to disconnect to my host, my host launch that exception:

      java.io.IOException: Se ha forzado la interrupción de una conexión existente por el host remoto
           at sun.nio.ch.SocketDispatcher.read0(Native Method)
           at sun.nio.ch.SocketDispatcher.read(Unknown Source)
           at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
           at sun.nio.ch.IOUtil.read(Unknown Source)
           at sun.nio.ch.SocketChannelImpl.read(Unknown 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