# Delay for XMLSocket Messages

**URL:** <https://forum.kirupa.com/t/delay-for-xmlsocket-messages/23459>\
**Category:** flash\
**Created:** [June 18, 2003, 9:40am UTC](https://forum.kirupa.com/t/delay-for-xmlsocket-messages/23459 "2003-06-18T09:40:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DumbMonkey](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DumbMonkey](https://forum.kirupa.com/u/DumbMonkey)\
**Post date:** [June 18, 2003, 9:40am UTC](https://forum.kirupa.com/t/delay-for-xmlsocket-messages/23459/1 "2003-06-18T09:40:14Z")

</div>

Hello,  
I am writing an XMLSocket Flash program and basically on startup,  
i call a funcion initialize, which connects the socket to the server and sends a message. Now I need to to wait for several startup messages from the server before I can continue. I need this to time out if they are not received. Does anyone have any ideas.  
Much appreciated,  
DumbMonkey.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 2:18pm UTC](https://forum.kirupa.com/t/delay-for-xmlsocket-messages/23459/2 "2003-06-18T14:18:18Z")

</div>

getTimer()

or

setInterva()

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 4:00pm UTC](https://forum.kirupa.com/t/delay-for-xmlsocket-messages/23459/3 "2003-06-18T16:00:54Z")

</div>

Hi and thanks,  
But I found if I do a while loop in the function, based on getTimer()  
it blocks the application and does not send the first message until the loop is complete. I basically need a non-blocking delay in my function.  
Thanks again,  
DumbMonkey
