close connection and log error when failed to send/recv/resolve name