trying to make generalized network reconnector in golang