move currentReply construction and messagesList.size() == 0 out of write(GatheringByteChannel channel), it will cause close connection in General Server/Client's loop