public override int EndRead(IAsyncResult asyncResult) { var result = asyncResult as AsyncResult; if (result.Return is Exception) throw (Exception)result.Return; return Convert.ToInt32(result.Return, CultureInfo.InvariantCulture); }