2 Replies Latest reply on Sep 18, 2008 11:02 AM by J B

    TCPCacheServer

    J B Novice

      Hi Guys,
      Was just looking at how this works in the 2.2 version. One thing that struck me when looking at it was that i didnt see the clean up of the at the end of the run method. Maybe its getting called from outside the package but just thought i would mention it cause everything looks to be encapsulated in this class

      So heres the run

      
       public void run()
       {
       int op;
       Fqn fqn;
       Object key, val, retval;
       NodeSPI n;
       boolean flag;
      ...........
       }
       output.flush();
       }
       catch (Exception e)
       {
       log.debug(e, e);
       try
       {
       output.writeObject(e);
       output.flush();
       }
       catch (IOException e1)
       {
       log.error(e1, e1);
       }
       }
       }
      


      Now was just curious of where the clean up happens, where/who is calling the close() ??

      Might be something, might be nothing but was just curious!!

      Thanks,
      LL



        • 1. Re: TCPCacheServer
          Manik Surtani Master

          close() is called when the TcpCacheServer's stop() method is called, or when there is an IO error in the connection's run() method.

          • 2. Re: TCPCacheServer
            J B Novice

             


            close() is called when the TcpCacheServer's stop() method is called, or when there is an IO error in the connection's run() method.


            Ah i see it now, your using the IOException to do the clean up for you!! As soon as the remote sides tears down its connection, the server side receives the IOException.

            Nah thats fine, just didnt see that bit ;)

            Thanks,
            LL