> ## 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.

# XGameStreamingGetClientIPAddress

> XGameStreamingGetClientIPAddress

# XGameStreamingGetClientIPAddress

> [!NOTE]
>
> **사용되지 않음.** 이 API는 2604 GDK 릴리스 기준으로 사용되지 않으며 향후 GDK 릴리스에서 제거될 예정입니다. 현재 XBOX Cloud Gaming 스트리밍 스택에서는 이 API가 작동하지 않으며 성공 시 `E_GAMESTREAMING_NO_DATA`를 반환합니다.
>
> 타이틀이 XBOX 게임 스트리밍 서버에서 실행되고 있는지 확인해야 하거나 사용자의 대략적인 지리적 위치가 필요한 경우 대신 [XSTS 토큰 클레임](/ko/services/xbox-services/fundamentals/s2s-auth-calls/service-authentication/security-tokens/live-token-claims)을 사용하세요.

이 API는 XBOX 게임 스트리밍 서비스를 통해 콘텐츠를 스트리밍하는 데 사용되는 최종 사용자 클라이언트 장치의 IP 주소를 반환합니다. 이 API 및 관련 정보는 정보 수집을 최종 사용자에게 알리는 것과 관련하여 Microsoft 표준 개인정보 보호 지침을 준수할 때만 사용해야 합니다. 이 API의 규정 준수 사용과 관련하여 질문이나 우려 사항이 있는 경우 Microsoft 담당자에게 문의하세요.

## 구문

```cpp theme={null}
HRESULT XGameStreamingGetClientIPAddress(  
         XGameStreamingClientId client,  
         size_t ipAddressSize,  
         char* ipAddress  
)  
```

### 매개 변수

*client*   \_In\_\
형식: XGameStreamingClientId

쿼리되는 스트리밍 클라이언트입니다.

*ipAddressSize*   \_In\_\
형식: size\_t

제공되는 `ipAddress` 버퍼의 최대 크기입니다. 일반적으로 이 값은 **ClientIPAddressMaxBytes** 여야 합니다.

*ipAddress*   \_Out\_writes\_z\_(ipAddressSize)\
형식: char\*

지정된 클라이언트의 IP 주소로 채워질 버퍼입니다.

### 반환값

형식: HRESULT

성공하면 **S\_OK** 를 반환합니다. 그렇지 않으면 오류 코드를 반환합니다.

#### 잠재적 오류

| 오류 코드 | 오류 값 | 오류 원인 |
| - | - | - |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | XGameStreaming 런타임이 초기화되지 않았습니다. 다른 API를 호출하기 전에 [XGameStreamingInitialize](/ko/reference/system/xgamestreaming/functions/xgamestreaminginitialize)를 호출합니다. |
| E\_GAMESTREAMING\_CLIENT\_NOT\_CONNECTED | 0x89245401 | 지정된 클라이언트가 연결되어 있지 않습니다. |
| E\_GAMESTREAMING\_NO\_DATA | 0x89245402 | 요청된 데이터를 사용할 수 없습니다. 데이터는 나중에 사용할 수 있을 수도 있습니다. |
| E\_NOT\_SUFFICIENT\_BUFFER | 0x7A | *ipAddress* 가 IP 주소와 null 종료 문자를 담기에 충분히 크지 않습니다. |

오류 코드 목록은 [오류 코드](/ko/reference/errorcodes)를 참조하세요.

## 설명

`ipAddress`는 IPv4 주소(1.2.3.4) 또는 IPv6 주소(1:2:3:4:5:6:7:8)일 수 있습니다. 필요한 경우 [ParseNetworkString](https://learn.microsoft.com/windows/win32/api/iphlpapi/nf-iphlpapi-parsenetworkstring)을 사용하여 문자열을 구문 분석할 수 있습니다.

반환되는 IP 주소는 XBOX가 스트리밍 클라이언트에서 받은 주소입니다. 스트리밍 클라이언트가 VPN을 사용하거나 NAT 뒤에 있는 경우 IP 주소를 지리적 위치 확인에 활용하는 데 문제가 있을 수 있습니다.

> [!NOTE]
>
> 스트리밍 클라이언트와 XBOX가 동일한 사설 네트워크에 있는 개발 또는 원격 플레이 시나리오에서는 사설 IP 주소가 반환될 수 있습니다.

## 예제

```C++ theme={null}
void GameStreamingClientManager::GetClientIPAddress(XGameStreamingClientId client)
{
    // Create the output buffer for the IP address
    char ipAddress[ClientIPAddressMaxBytes]; 

    // Get the IP address of the client 
    HRESULT hr = XGameStreamingGetClientIPAddress(client, ClientIPAddressMaxBytes, ipAddress); 

    if (SUCCEEDED(hr)) 
    { 
        // Game logic to use IP address
    } 
    else if (hr == E_GAMESTREAMING_CLIENT_NO_DATA) 
    { 
        // Game logic handles no data on client case 
    } 
    else 
    { 
        // In case of error just log and proceed as if there was no data 
        LogFormat(L"XGameStreamingGetClientIPAddress failed %x", hr); 
    } 
}
```

## 요구 사항

**헤더:** xgamestreaming.h\
**라이브러리:** xgameruntime.lib\
**지원되는 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XGameStreaming](/ko/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [Xbox Game Streaming 개발 모범 사례](/ko/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XGameStreamingClientProperty](/ko/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
- [XGameStreaming (API 콘텐츠)](/ko/reference/system/xgamestreaming/xgamestreaming_members.md)
- [Unity 프로젝트에서 GDK API용 C# 래퍼 사용](/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameStreamingGetClients](/ko/reference/system/xgamestreaming/functions/xgamestreaminggetclients.md)
