1 Reply Latest reply on Mar 30, 2006 2:19 AM by Tom Elrod

    Version exception on connection close

    Tim Fox Master

      Tom et al,

      as you know we are getting a lot of the following exception:

      java.io.IOException: Can not read data for version -1. Supported versions: 1,2

      with the latest remoting in CVS.

      This seems to occur if a socket connection is closed from the client side, which causes the server read to return -1 which it incorrectly interprets as a version number.

      I notice in the code of ServerThread you have considered this but decided not to check for it:

       * This is a best attempt to determine if is old version. Typically, the first
       * byte will be -1, so if is, will reset stream and process as though is older version
      // if(version == -1)
      // {
      // version = Version.VERSION_1;
      // inputStream.reset();
      // }

      Any chance of checking this and handling it gracefully?