First, you should NEVER EVER use "Application.ProcessMessages" from within RTC events, because this can result in unexpected inner loops, caused by windows messages! And second, using loops inside RTC events to wait for "some condition" is also a bad idea, because you are suspending a connection and blocking a thread this way. These rules apply to single-thread as well as multi-threaded applications.
There are already several threads in this forum explaining how Delayed Calls work, and how they should be used.
Here are the most relevant topics:
How to work TRtcDelayedCall?Streaming headlines...Messenger example and delayed callsShould you have more questions after checking these topics, please ask.
Best Regards,
Danijel Tkalcec