connection code was reworked to be general for the four high level exports from this file.  waiting for 'connect' also allows us to differentiate connection failures from bind failures.