server.h 385 B

123456789101112131415161718
  1. #pragma once
  2. #include <stdint.h>
  3. class CIOBuffer;
  4. class EpollServer
  5. {
  6. public:
  7. static EpollServer& GetInstance();
  8. void Loop();
  9. private:
  10. void et(struct epoll_event* events, int number, int epollfd, int listenfd);
  11. private:
  12. void addfd(int epollfd,int fd, void * ptr, int enable_et);
  13. int setnonblocking(int fd);
  14. private:
  15. int32_t _listenfd;
  16. int32_t _epollfd;
  17. };