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

# XNetworkingConnectivityHintChangedCallback

> XNetworkingConnectivityHintChangedCallback

# XNetworkingConnectivityHintChangedCallback

Gets called when the connectivity hint structure is changed.

## Syntax

```cpp theme={null}
void XNetworkingConnectivityHintChangedCallback(
         void* context,
         const XNetworkingConnectivityHint* connectivityHint
)
```

### Parameters

*context*   \_In\_opt\_\
Type: void\*

An optional context pointer that was passed to the [XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged) function.

*connectivityHint*   \_In\_\
Type: [XNetworkingConnectivityHint](/reference/networking/xnetworking/structs/xnetworkingconnectivityhint)\*

The new device-wide connectivity hint structure.

### Return value

Type: void

## Remarks

This callback function is called when something about the device's current connectivity changes. It includes the context pointer passed when the register function was called. The triggering of this callback does not guarantee that something changed from the last time the callback triggered.

<Note>Best-effort pertains to the current device-wide state of the network and network connectivity level. Network initialization must be respected that it is not best-effort because initialization can infrequently not happen.</Note>

The fields in the returned `XNetworkingConnectivityHint` structure (except the `XNetworkingConnectivityHint::networkInitialized` field) are hints. They are best-effort guesses by the device about the current state of the network based on a summary of the network traffic on the device. Importantly, these fields do not represent whether there is connectivity to your specific title endpoints. We recommend that, after waiting for network initialization, you use WinSock and/or WinHTTP to try to establish a connection to your endpoint regardless of the state of the `XNetworkingConnectivityHint::connectivityLevelHint` field. If those APIs subsequently fail, we recommend that you then use the `XNetworkingGetConnectivityHint` API for additional UI and diagnostic reporting purposes. You should then wait for a change in the network connectivity level before trying again.

This method interrogates the local state within the calling process and returns quickly, so it is safe to call from time-sensitive contexts.

## Requirements

**Header:** XNetworking.h

**Library:** xgameruntime.lib

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

## See also

[Retrieving Network Information](/build/console-features/networking/initialization-connectivity-networking)\
[XNetworkingGetConnectivityHint](/reference/networking/xnetworking/functions/xnetworkinggetconnectivityhint)\
[XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged)\
[XNetworkingUnregisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingunregisterconnectivityhintchanged)\
[XNetworking](/reference/networking/xnetworking/xnetworking_members)


## Related topics

- [XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged.md)
- [XNetworkingUnregisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingunregisterconnectivityhintchanged.md)
- [XNetworking](/reference/networking/xnetworking/xnetworking_members.md)
- [XNetworkingGetConnectivityHint](/reference/networking/xnetworking/functions/xnetworkinggetconnectivityhint.md)
- [XNetworkingConnectivityHint](/reference/networking/xnetworking/structs/xnetworkingconnectivityhint.md)
