openGauss项目TCP/IP代码注释 #24

Open
shuimuzhihua wants to merge 15 commits from shuimuzhihua/openGauss-server:master into master
1 changed files with 24 additions and 11 deletions
Showing only changes of commit dae34bd1b5 - Show all commits

View File

@ -30,24 +30,37 @@
#define MC_POLLER_HAVE_ASYNC_ADD 1
#define MC_POLLER_MAX_EVENTS 512
#define MC_POLLER_MAX_EVENTS 512 // 目前正在处理事件epoll_event的最大数目
#define MC_POLLER_FD_ID_OFFSET 32
#define MC_POLLER_FD_ID_OFFSET 32 // fd的移位值左移
#define MC_POLLER_FD_ID_MASK 0xffff
// Item of epoller list, including poller handler and list item.
//
struct mc_poller_hndl_item {
// 定义一个结构体mc_poller_hndl_item用于存储poller句柄和列表项
struct mc_poller_hndl_item
{
struct mc_poller_hndl hndl;
struct mc_list_item item;
};
struct mc_poller {
int ep; // Current pollset.
int nevents; // Number of events being processed at the moment.
int index; // Index of the event being processed at the moment.
struct epoll_event events[MC_POLLER_MAX_EVENTS]; // Events being processed at the moment.
/*
struct mc_poller_hndl
{
int fd; // 文件描述符
int id; // 与文件描述符相关联的标识符或索引(标识特定连接或资源的唯一标识符)
uint32_t events; // 事件
};
struct mc_list_item
{
struct mc_list_item* next; // 具有一个指向自己类型的指针
};
*/
struct mc_poller
{
int ep; // 当前poller值
int nevents; // 当前正在处理的事件数
int index; // 当前正在处理的事件的索引
struct epoll_event events[MC_POLLER_MAX_EVENTS]; // 目前正在处理事件
};
#endif