Modified to return an exception(E_INVALID_STATE) when you try to connect to a speicif...