private int read() throws Exception {
		this.readBuffer.clear();
		int count = this.socketChannel.read(this.readBuffer);
		this.readBuffer.flip();
		if (count > 0) {
			if (GlobalUtil.SHOW_SYSTEM_OUT)
				System.out.println(Thread.currentThread().getId() + " Read " + count + " bytes from socketChannel.");
			this.messageCodecHandler.decodeMessage(this.readBuffer, new CoreMessageDecoderCallback() {
				@Override
				public void onCoreMessageDecoded(CoreMessage message) {
					if (message.getType().equals(CoreMessageType.USER_MESSAGE)) {
						if (GlobalUtil.SHOW_SYSTEM_OUT)
							System.out.println(Thread.currentThread().getId() + " Decoded message " + message.getType().toString() + " type int: "
									+ ((UserMessage) message.getMessageData()).messageType);
					} else if (!message.getType().equals(CoreMessageType.KEEP_ALIVE_MESSAGE)) {
						if (GlobalUtil.SHOW_SYSTEM_OUT)
							System.out.println(Thread.currentThread().getId() + " Decoded message " + message.getType().toString());
					}
					switch (message.getType()) {
					case KEEP_ALIVE_MESSAGE:
						if (!needToKeepAlive) {
							// 当前实例不需要主动保持心跳时，直接给一个回应
							addMessageToWriteQueue(new CoreMessage(CoreMessageType.KEEP_ALIVE_MESSAGE, null));
						}
						break;
					case UNKNOWN:
						break;
					default:
						onMessageDecoded(message);
						break;
					}
				}
			});
		}
		return count;
	}