> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblContextSettingsGetHttpRetryDelay

> XblContextSettingsGetHttpRetryDelay

# XblContextSettingsGetHttpRetryDelay

取得以秒為單位的 HTTP 重試延遲。

## 語法

```cpp theme={null}
HRESULT XblContextSettingsGetHttpRetryDelay(  
         XblContextHandle context,  
         uint32_t* delayInSeconds  
)  
```

### 參數

*context*   \_In\_\
類型：[XblContextHandle](/zh-TW/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

與設定相關聯的 XBOX Live 內容。

*delayInSeconds*   \_Out\_\
類型：uint32\_t\*

傳回以秒為單位的重試延遲。重試會使用指數退避來延遲。根據預設，會先延遲 2 秒，下一次重試延遲 4 秒，然後是 8 秒，依此類推，最多 1 分鐘，直到呼叫成功或達到 http\_timeout\_window 為止，此時呼叫將會失敗。延遲時間也會在目前與下一次延遲之間隨機抖動，以分散服務負載。http\_timeout\_window 的預設值為 20 秒，可使用 XblContextSettingsSetHttpTimeoutWindow 變更。

### 傳回值

類型：HRESULT

此 API 作業的 HRESULT 傳回碼。

## 備註

如果服務傳回含有 "Retry-After" 標頭的 HTTP 錯誤，則在達到 "Retry-After" 時間之前，之後對該 API 的所有呼叫都會立即以原始錯誤失敗，而不會連絡服務。<br /> 發生網路錯誤或伺服器以下列其中一個 HTTP 狀態碼回應時，會重試等冪服務呼叫：<br /> 408 (要求逾時)<br /> 429 (要求過多)<br /> 500 (內部伺服器錯誤)<br /> 502 (錯誤的閘道)<br /> 503 (服務無法使用)<br /> 504 (閘道逾時)<br />

## 需求

**標頭：** xbox\_live\_context\_settings\_c.h

**程式庫：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另請參閱

[xbox\_live\_context\_settings\_c](/zh-TW/reference/live/xsapi-c/xbox_live_context_settings_c/xbox_live_context_settings_c_members)


## Related topics

- [XblContextSettingsSetHttpRetryDelay](/zh-TW/reference/live/xsapi-c/xbox_live_context_settings_c/functions/xblcontextsettingssethttpretrydelay.md)
- [XblContextSettingsGetHttpTimeoutWindow](/zh-TW/reference/live/xsapi-c/xbox_live_context_settings_c/functions/xblcontextsettingsgethttptimeoutwindow.md)
- [XblContextSettingsGetLongHttpTimeout](/zh-TW/reference/live/xsapi-c/xbox_live_context_settings_c/functions/xblcontextsettingsgetlonghttptimeout.md)
- [HCHttpCallRequestGetRetryDelay](/zh-TW/reference/live/httpclient/httpprovider/functions/hchttpcallrequestgetretrydelay.md)
- [PFHttpRetrySettings](/zh-TW/services/playfab/api-references/c/pfhttpconfig/structs/pfhttpretrysettings.md)
