@Override
    public void run() {
    	textArea.append("A connection thread run!\n");    
        
    	// Receive message
        while (true) {
            try {
            	if (connection.getInputStream() == null) {
            		textArea.append("Connection's input stream doesn't exist\n");
            		return ;
            	}
                TimeStampedMessage message = (TimeStampedMessage)connection.getInputStream().readObject();
        		
                if (message != null) {
                    receiveBuffer.add(message);
                }
            } catch (ClassNotFoundException e) {
            	textArea.append("Cast object fail!\n");
            } catch (IOException e) {
            	textArea.append("Close this socket. ");
                break;
            }
        }
        
        Iterator<Entry<String, Connection>> iter = connectionPool.entrySet().iterator(); 
		while (iter.hasNext()) { 
			Entry<String, Connection> entry = iter.next();
			if (entry.getValue() == connection) {
				connectionPool.remove(entry.getKey());
				entry.getValue().close();
				break;
			}
		}
        
        textArea.append("Thread exit...\n");
    }