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

# XNetworkingTcpQueuedReceivedBufferUsageStatistics

> XNetworkingTcpQueuedReceivedBufferUsageStatistics

# XNetworkingTcpQueuedReceivedBufferUsageStatistics

当使用 [XNetworkingQueryStatistics](/reference/networking/xnetworking/functions/xnetworkingquerystatistics) 查询网络统计信息，并指定 TitleTcpQueuedReceivedBufferUsage、SystemTcpQueuedReceivedBufferUsage 或 ToolsTcpQueuedReceivedBufferUsage [XNetworkingStatisticsType](/reference/networking/xnetworking/enums/xnetworkingstatisticstype) 值时，所返回的输出结构体。

## 语法

```cpp theme={null}
typedef struct XNetworkingTcpQueuedReceivedBufferUsageStatistics {  
    uint64_t numBytesCurrentlyQueued;  
    uint64_t peakNumBytesEverQueued;  
    uint64_t totalNumBytesQueued;  
    uint64_t numBytesDroppedForExceedingConfiguredMax;  
    uint64_t numBytesDroppedDueToAnyFailure;  
} XNetworkingTcpQueuedReceivedBufferUsageStatistics  
```

### 成员

*numBytesCurrentlyQueued*\
类型：uint64\_t

当前分配的、用于保存尚未从其相应 TCP 套接字中读取的已接收有效负载的所有内核模式缓冲区的大小（以字节为单位）。游戏可通过对其 TCP 套接字调用 [WSARecv](https://learn.microsoft.com/windows/win32/api/winsock2/nf-winsock2-wsarecv) 或类似函数来消耗已有的分配，从而减小队列大小；也可通过预先提交足够的接收操作（及其缓冲区）来防止此类分配的发生。

*peakNumBytesEverQueued*\
类型：uint64\_t

所有内核模式缓冲区中，为保存尚未从其相应 TCP 套接字中读取的已接收有效负载而在任一时刻曾经同时分配过的最大总大小（以字节为单位）。

*totalNumBytesQueued*\
类型：uint64\_t

所有内核模式缓冲区中，为保存尚未从其相应 TCP 套接字中读取的已接收有效负载而曾经分配的字节总数。

*numBytesDroppedForExceedingConfiguredMax*\
类型：uint64\_t

已到达但被丢弃的 TCP 有效负载字节数，之所以被丢弃是因为，如果将它们与已分配的字节数 (*numBytesCurrentlyQueued*) 合并，将超过该内存分区允许的最大值（参见 [XNetworkingConfigurationSetting](/reference/networking/xnetworking/enums/xnetworkingconfigurationsetting)::MaxTitleTcpQueuedReceiveBufferSize、[XNetworkingConfigurationSetting](/reference/networking/xnetworking/enums/xnetworkingconfigurationsetting)::MaxSystemTcpQueuedReceiveBufferSize 或 [XNetworkingConfigurationSetting](/reference/networking/xnetworking/enums/xnetworkingconfigurationsetting)::MaxToolsTcpQueuedReceiveBufferSize）。

*numBytesDroppedDueToAnyFailure*\
类型：uint64\_t

已到达但被丢弃的 TCP 有效负载字节数，之所以被丢弃是因为出于任何原因分配排队接收缓冲区都失败了（其中包括 *numBytesDroppedForExceedingConfiguredMax*，也包括在最大值以下但在当时该内存分区实际可用内存不足的分配尝试）。

## 要求

**头文件：** XNetworking.h

**支持的平台**：Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XNetworking](/reference/networking/xnetworking/xnetworking_members)\
[XNetworkingQueryStatistics](/reference/networking/xnetworking/functions/xnetworkingquerystatistics)\
[XNetworkingStatisticsBuffer](/reference/networking/xnetworking/structs/xnetworkingstatisticsbuffer)


## Related topics

- [XNetworkingStatisticsBuffer](/zh-CN/reference/networking/xnetworking/structs/xnetworkingstatisticsbuffer.md)
- [XNetworkingStatisticsType](/zh-CN/reference/networking/xnetworking/enums/xnetworkingstatisticstype.md)
- [XNetworking](/zh-CN/reference/networking/xnetworking/xnetworking_members.md)
- [XNetworkingConfigurationSetting](/zh-CN/reference/networking/xnetworking/enums/xnetworkingconfigurationsetting.md)
- [PartyLocalEndpoint::SendMessage](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md)
