Optional callback on client.connect

Improved API doc