Call connect() from the metadata handler thread.