# Trying not to get in a knot with comms

**URL:** <https://forum.kirupa.com/t/trying-not-to-get-in-a-knot-with-comms/168866>\
**Category:** flash\
**Created:** [November 10, 2005, 7:37pm UTC](https://forum.kirupa.com/t/trying-not-to-get-in-a-knot-with-comms/168866 "2005-11-10T19:37:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IWantedJim](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@IWantedJim](https://forum.kirupa.com/u/IWantedJim)\
**Post date:** [November 10, 2005, 7:37pm UTC](https://forum.kirupa.com/t/trying-not-to-get-in-a-knot-with-comms/168866/1 "2005-11-10T19:37:04Z")

</div>

I’ve got a basic class working which is communicating via telnet. I basically use the command jim.send(“message”) to send a message.

When a response is recieved a event is raised and the data sent through to whatever function I have defined.

But what I want to do is stepping though, if it was another language I’d do this…

jim.send(“message”)  
loop until response or timeout  
look at response, if bad exit  
jim.send(“next message”)  
loop until response or timeout  
look at response, if bad exit  
jim.send(“next message”)  
loop until response or timeout  
look at response, if bad exit

etc…

How best to do this sort of thing in Flash, seeing as it doesn’t like to sit around and wait in a loop, yet keep it as simple as above if possible?
