check for socket error