Hey muslim,
I don't think there is a problem with the example code. I tested it and it worked fine for me. When you say it waits indefinitely, does it wait at the Resample and Write VI or in the loop? Does the status say "Downloading" or "Generating"? If it says "Generating" then the code is working correctly. It will wait in the loop indefinitely until either the user presses the stop button or there is an error. I would double check the code on your receiving side. If you can't hear the file I would make sure that you are correctly demodulating and then playing the sound file back correctly.
Regards,
Chris Delvizis
National Instruments