fix can't connect message with socket

Fixes #1540