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

# XNetworkingUnregisterConnectivityHintChanged

> XNetworkingUnregisterConnectivityHintChanged

# XNetworkingUnregisterConnectivityHintChanged

Unregisters a callback function that was registered with [XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged).

## Syntax

```cpp theme={null}
bool XNetworkingUnregisterConnectivityHintChanged(
         XTaskQueueRegistrationToken token,
         bool wait
)
```

### Parameters

*token*   \_In\_\
Type: [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

The token returned from [XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged).

*wait*   \_In\_\
Type: bool

Indicates whether to block until any pending callbacks are completed.

### Return value

Type: bool

Returns false if *wait* is false and the unregister call is pending. Returns true otherwise.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

This function performs the following actions:

* The callback associated with the token is removed from the set of registered callbacks.
* If no callbacks are executing for that callback token, the call returns true.
* If callbacks are executing and *wait* is true, the call blocks until the executing callback has finished.
* If callbacks are executing and *wait* is false, the call does not block but does return false. When the callback for the token is complete, the token is automatically unregistered.

<Note>This function should not be called from within an [XNetworkingConnectivityHintChangedCallback](/reference/networking/xnetworking/functions/xnetworkingconnectivityhintchangedcallback) if *wait* is true since this will deadlock.</Note>

This mechanism allows for the following coding patterns:

* You can block on unregistration to ensure your callbacks are never invoked after an unregister call.
* You can choose not to block. If you need to ensure your callbacks are completed before deleting data, you can periodically call this function with *wait* set to false. When it finally returns true, all your callbacks are completed and you can delete the state.
* If your callback doesn't care whether it is being invoked during an unregister call, you can pass false for *wait* and ignore the return value.

## Requirements

**Header:** XNetworking.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged)\
[XNetworkingGetConnectivityHint](/reference/networking/xnetworking/functions/xnetworkinggetconnectivityhint)\
[Network Initialization & Connectivity](/build/console-features/networking/initialization-connectivity-networking)\
[XNetworking](/reference/networking/xnetworking/xnetworking_members)


## Related topics

- [XNetworkingRegisterConnectivityHintChanged](/reference/networking/xnetworking/functions/xnetworkingregisterconnectivityhintchanged.md)
- [XNetworkingConnectivityHintChangedCallback](/reference/networking/xnetworking/functions/xnetworkingconnectivityhintchangedcallback.md)
- [XNetworkingGetConnectivityHint](/reference/networking/xnetworking/functions/xnetworkinggetconnectivityhint.md)
- [Detecting network initialization status](/build/console-features/networking/initialization-connectivity-networking.md)
- [XNetworking](/reference/networking/xnetworking/xnetworking_members.md)
