refine Connection; fix some socket error situation