fix a bug in sock reconnection.

Signed-off-by: Daogang Tang <daogangtang@gmail.com>