in reply to Timed event within a script
You may find the select method shown by tybalt89 in Re: UDP Client and Server in one of interest too