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

# PartyManager::GetNetworks

> Gets an array of all networks to which the local device is connected or connecting.

Gets an array of all networks to which the local device is connected or connecting.

## Syntax

```cpp theme={null}
PartyError GetNetworks(  
    uint32_t* networkCount,  
    PartyNetworkArray* networks  
)  
```

### Parameters

**`networkCount`**   uint32\_t\*\
*output*

The output number of networks to which the local device is connected or connecting provided in `networks`.

**`networks`**   [PartyNetworkArray\*](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/typedefs.md)\
*library-allocated output array of size `*networkCount`*

A library-allocated output array containing the networks to which the local device is connected or connecting.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [GetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage.md).

## Remarks

Once a [PartyNetworkDestroyedStateChange](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partynetworkdestroyedstatechange.md) has been provided by [PartyManager::StartProcessingStateChanges()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges.md), the network will no longer be present in the array returned by this method. \
\
&#x20;The memory for the returned array is invalidated whenever the title calls PartyManager::StartProcessingStateChanges() or [ConnectToNetwork()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_connecttonetwork.md) returns success.

## Requirements

**Header:** Party.h

## See also

[PartyManager](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/partymanager.md)\
[PartyManager::ConnectToNetwork](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_connecttonetwork.md)\
[PartyNetwork::LeaveNetwork](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_leavenetwork.md)\
[PartyNetworkDestroyedStateChange](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partynetworkdestroyedstatechange.md)


## Related topics

- [PartyManager::Cleanup](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_cleanup.md)
- [PartyManager::ConnectToNetwork](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_connecttonetwork.md)
- [PartyChatControl::GetNetworks](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getnetworks.md)
- [PartyEndpoint::GetNetwork](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getnetwork.md)
- [PartyManager::SerializeNetworkDescriptor](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_serializenetworkdescriptor.md)
