Did my code destroy the arduino?

A connection stays active until terminated. As long as it exists any other connection attempt will fail.