Avoid socket before connecting, socket sets is not valid.

Signed-off-by: jack <jack.wgm@gmail.com>