IOException should be thrown if connection failed