receive_msg should return false if connection failed.