log.trace("ConnectionTable.Connection.HandlerThread terminated"); handler=null;
log.trace("ConnectionTable.Connection.Receiver terminated"); receiverThread=null;
        public void run() {            Message msg;            byte[] buf=new byte[256];            int len=0;            while(handler != null && handler.equals(Thread.currentThread())) {                try {                    if(in == null) {                        if(log.isErrorEnabled()) log.error("input stream is null !");                        break;                    }                    len=in.readInt();                    if(len > buf.length)                        buf=new byte[len];                    in.readFully(buf, 0, len);                    updateLastAccessed();                    msg=(Message)Util.objectFromByteBuffer(buf);                    receive(msg); // calls receiver.receiver(msg)                }                catch(OutOfMemoryError mem_ex) {                    if(log.isWarnEnabled()) log.warn("dropped invalid message, closing connection");                    break; // continue;                }                catch(EOFException eof_ex) {  // peer closed connection                    if(log.isInfoEnabled()) log.info("exception is " + eof_ex);                    notifyConnectionClosed(peer_addr);                    break;                }                catch(IOException io_ex) {                    if(log.isInfoEnabled()) log.info("exception is " + io_ex);                    notifyConnectionClosed(peer_addr);                    break;                }                catch(Throwable e) {                    if(log.isWarnEnabled()) log.warn("exception is " + e);                }            }            if(log.isTraceEnabled())                log.trace("ConnectionTable.Connection.HandlerThread terminated");            handler=null;            closeSocket();            remove(peer_addr);        }