timerf_create(2)函数把时间变成了一个描述符,该文件描述符在定时器超时的那一刻变得可读,这样就方便融入select(2)或poll(2)中去。 下面翻译官方说明: #include <sys/timerfd.h>inttimerfd_create(intclockid,intflags);inttimerfd_settime(intfd,intflags,conststructitimerspec *new_value,structitimerspec *...
(network->socketpool = socketpool_create()))gotoERR_SOCKETPOOL;if(!(network->sendq = queue_create()))gotoERR_SENDQ;if(!(network->recvq = queue_create()))gotoERR_RECVQ;if((network->timerfd =timerfd_create(CLOCK_REALTIME,0)) ==-1) {gotoERR_TIMERFD;...