Refine some codes in ConnectionAgent.

Signed-off-by: 核心力量 <kernelforce@gmail.com>