Connect to a client to publish or subscribe.