Print error message when tcp socket can't connect