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

# PartyLocalEndpoint::FlushMessages

> 强制从此本地终结点发送到指定终结点的所有排队消息尽快发送，无论其合并设置如何。

强制从此本地终结点发送到指定终结点的所有排队消息尽快发送，无论其合并设置如何。

## Syntax

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

### Parameters

**`targetEndpointCount`**   uint32\_t

此参数当前被忽略。`targetEndpoints` 数组中目标终结点的数量。

**`targetEndpoints`**   [PartyEndpointArray](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/typedefs.md)\
*input array of size `targetEndpointCount`*

此参数当前被忽略。包含 `targetEndpointCount` 个条目的目标 PartyEndpoint 对象指针数组。从此本地终结点发送到数组中任何终结点的、直至并包括最新消息的所有消息，都将尽快传输。

### Return value

PartyError

如果刷新消息成功，则返回 `c_partyErrorSuccess`；否则返回错误代码。可通过 [PartyManager::GetErrorMessage()](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage.md) 检索错误代码的可读形式。

## Remarks

当在对 [SendMessage()](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md) 的调用中指定了 [PartySendMessageOptions::CoalesceOpportunistically](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions.md) 或 [PartySendMessageOptions::AlwaysCoalesceUntilFlushed](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions.md) 时，消息可能不会立即传输，而是与其他消息合并。这种合并可以提高带宽效率，但可能会增加感知延迟。此方法允许标题手动强制此类合并消息尽快开始传输。\
\
&#x20;目前，此方法忽略 `targetEndpoints` 参数，并强制此本地终结点的所有排队消息尽快传输。

## Requirements

**Header:** Party.h

## See also

[PartyLocalEndpoint](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint.md)\
[PartyLocalEndpoint::SendMessage](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md)\
[PartySendMessageOptions](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions.md)


## Related topics

- [PartyLocalEndpoint::SendMessage](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md)
- [PartySendMessageOptions](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions.md)
- [PartyNetwork::DestroyEndpoint](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_destroyendpoint.md)
- [传输选项](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/transport-options.md)
- [PartyLocalEndpoint](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint.md)
