Hmm, receiveFile starts a new thread to receive the data. I also found nothing that would explain why adding the monitoring into a new thread would "unblock" the thread somehow.
Glad that it did work for you, though we still have no clue about what went wrong.