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

# XGameStreamingGetServerLocationName

> XGameStreamingGetServerLocationName

# XGameStreamingGetServerLocationName

Gets the name of the location of the streaming server's data center.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetServerLocationName(
         size_t serverLocationNameSize,
         char* serverLocationName
)
```

<a id="parametersSection" />

### Parameters

*serverLocationNameSize*   \_In\_\
Type: size\_t

The maximum size of the data center location name to return.
The `serverLocationNameSize` should be retrieved by calling [XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize).

*serverLocationName*   \_Out\_writes\_z\_(serverLocationNameSize)\
Type: char\*

The name of the Azure Region with the data center hosting the streaming XBOX server.

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns **S\_OK** if successful; otherwise, returns an error code.

**Potential Errors**

| Error Code                         | Error Value | Reason for Error                                                                                                                                                                     |
| ---------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400  | The XGameStreaming runtime has not been initialized. Call [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize) before calling other APIs. |
| E\_NOT\_SUFFICIENT\_BUFFER         | 0x7A        | *serverLocationSize* is not large enough to hold the full name of the server location (and its terminating null character).                                                          |
| E\_GAMESTREAMING\_NO\_DATACENTER   | 0x89245403  | The current machine is not running in a datacenter.                                                                                                                                  |

For a list of error codes, see [Error Codes](/reference/errorcodes).

<a id="remarksSection" />

## Remarks

Before you call this function, you can call [XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize) to get the size of the server location name so that you can allocate a buffer.

You can utilize the Azure Region if the game wants to connect to a game server that is hosted on Azure PlayFab Multiplayer Servers, and wants a minimium latency with its game server.

The error of `E_GAMESTREAMING_NO_DATACENTER` can occur when a player is using Console Streaming to stream the game from their home XBOX.  This error can also occur on an XBOX Developer Kit if you have not set an override value.

On an XBOX Developer Kit, you can set the `serverLocationName` that should be returned during testing, in the **Streaming** tab of the **Developer Home**.

<a id="requirementsSection" />

## Requirements

**Header:** xgamestreaming.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)\
[XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize)


## Related topics

- [XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md)
- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
- [Optimizing your game for XBOX Game Streaming](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameStreamingGetTouchBundleVersionNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversionnamesize.md)
