Combined doConnect and doConnect_a.