Allow existing Socket object to be injected.