Make connect and disconnect blocking.