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

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

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

## Syntax

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

### Parameters

**`targetEndpointCount`**   uint32\_t

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

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

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

### Return value

PartyError

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

## Remarks

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

## 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](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md)
- [PartySendMessageOptions](/zh-CN/services/playfab/multiplayer/networking/reference/enums/partysendmessageoptions.md)
- [PartyNetwork::DestroyEndpoint](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_destroyendpoint.md)
- [传输选项](/zh-CN/services/playfab/multiplayer/networking/transport-options.md)
- [PartyLocalEndpoint](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint.md)
