Implement dh_connect