mbed official WiflyInterface (interface for Roving Networks Wifly modules)
Using the example code and library for the Wifly, it would often fail to connect to a network. It turned out that several essential commands required more than 500 msec in order to reliably connect.
Please see the 22 March 2013 entry in the URL link. At least for one Wifly, running software 2.45, it required:
572 msec for "set w s myssid",
585 msec for "set w p The$Pass$Phrase", and
716 msec for "join"
I appreciate the timeout mechanism, that's a great practice. I also recognize that simple examples are appropriate starters. These two just happened to work against each other with the 500 msec setting. Changing the define to a more generous 1000 worked.