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

# PartyLocalEndpoint::FlushMessages

> Forces all queued messages to the specified endpoints from this local endpoint to be sent as soon as possible regardless of their coalesce settings.

Forces all queued messages to the specified endpoints from this local endpoint to be sent as soon as possible regardless of their coalesce settings.

## Syntax

```cpp theme={null}
PartyError FlushMessages(  
    uint32_t targetEndpointCount,  
    PartyEndpointArray targetEndpoints  
)  
```

### Parameters

**`targetEndpointCount`**   uint32\_t

This parameter is currently ignored. The number of target endpoints in the `targetEndpoints` array.

**`targetEndpoints`**   [PartyEndpointArray](/services/playfab/multiplayer/networking/reference/typedefs)\
*input array of size `targetEndpointCount`*

This parameter is currently ignored. A `targetEndpointCount` entry array of target PartyEndpoint object pointers. Messages from this local endpoint, up through and including the most recent message to any endpoint in the array, will be transmitted as soon as possible.

### Return value

PartyError

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

## Remarks

When [PartySendMessageOptions::CoalesceOpportunistically](/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions) or [PartySendMessageOptions::AlwaysCoalesceUntilFlushed](/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions) is specified in a call to [SendMessage()](/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage), the message may not be transmitted immediately and instead be combined with other messages. This coalescing can improve bandwidth efficiency at the potential expense of perceived latency. This method allows the title to manually force such coalesced messages to begin transmitting as soon as possible. <br /><br /> Currently this method ignores the `targetEndpoints` parameter and forces all queued messages from this local endpoint to be transmitted as soon as possible.

## Requirements

**Header:** Party.h

## See also

[PartyLocalEndpoint](/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint)\
[PartyLocalEndpoint::SendMessage](/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage)\
[PartySendMessageOptions](/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions)


## Related topics

- [PartyLocalEndpoint::SendMessage](/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md)
- [PartySendMessageOptions](/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions.md)
- [PartyNetwork::DestroyEndpoint](/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_destroyendpoint.md)
- [Transport options](/services/playfab/multiplayer/networking/transport-options.md)
- [PartyLocalEndpoint](/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint.md)
