http://www.ixora.com.au/tips/use_asynchronous_io.htm