STTNet 0.7.0
Loading...
Searching...
No Matches
stt::network::ConnectionWriteState Struct Reference

单个服务端连接的有界异步发送状态。 More...

#include <sttnet.h>

Public Attributes

std::mutex mutex
 
std::deque< std::string > queue
 
size_t front_offset =0
 
size_t queued_bytes =0
 
size_t max_queued_bytes =4UL*1024UL*1024UL
 
int fd =-1
 
uint64_t connection_obj_fd =0
 
bool notification_pending =false
 
bool close_requested =false
 
bool close_after_flush =false
 
bool overflowed =false
 
bool closed =false
 

Detailed Description

单个服务端连接的有界异步发送状态。

Note
TcpServer 创建和管理;公开定义是为了让 handler 安全持有共享状态,业务代码不应直接修改字段。

Member Data Documentation

◆ close_after_flush

bool stt::network::ConnectionWriteState::close_after_flush =false

是否等待队列排空后关闭。

◆ close_requested

bool stt::network::ConnectionWriteState::close_requested =false

是否请求 Reactor 关闭连接。

◆ closed

bool stt::network::ConnectionWriteState::closed =false

状态是否已停止接受数据。

◆ connection_obj_fd

uint64_t stt::network::ConnectionWriteState::connection_obj_fd =0

fd 复用保护代次。

◆ fd

int stt::network::ConnectionWriteState::fd =-1

底层文件描述符。

◆ front_offset

size_t stt::network::ConnectionWriteState::front_offset =0

队首数据块已写出的偏移。

◆ max_queued_bytes

size_t stt::network::ConnectionWriteState::max_queued_bytes =4UL*1024UL*1024UL

本连接待发高水位。

◆ mutex

std::mutex stt::network::ConnectionWriteState::mutex

保护本结构中其余可变字段。

◆ notification_pending

bool stt::network::ConnectionWriteState::notification_pending =false

是否已有 send-ready 通知在途。

◆ overflowed

bool stt::network::ConnectionWriteState::overflowed =false

是否曾超过高水位。

◆ queue

std::deque<std::string> stt::network::ConnectionWriteState::queue

保持业务提交顺序的完整数据块。

◆ queued_bytes

size_t stt::network::ConnectionWriteState::queued_bytes =0

当前尚未写出的总字节数。


The documentation for this struct was generated from the following file: