02 2024 档案

摘要:InetAddress 这个类主要封装了套接字地址的相关成员变量及方法 class InetAddress : public muduo::copyable { public: /// Constructs an endpoint with given port number. /// Mostly 阅读全文
posted @ 2024-02-29 16:24 孟秋十三 阅读(21) 评论(0) 推荐(0)
摘要:Channel Channel类概述 ​ Channel类其实相当于一个文件描述符的保姆;在TCP网络编程中,想要IO多路复用监听某个文件描述符,就要把这个fd和该fd感兴趣的事件通过epoll_ctl注册到IO多路复用模块(我管它叫事件监听器)上。当事件监听器监听到该fd发生了某个事件。事件监听器 阅读全文
posted @ 2024-02-28 20:39 孟秋十三 阅读(11) 评论(0) 推荐(0)
摘要:Poller 该类是一个抽象类,声明了在IO复用过程中用到的必要接口;主要有以下几类 /// Polls the I/O events. /// Must be called in the loop thread. /// 用于轮询IO事件,返回的时间戳代表轮询完成的事件,同时通过activeCha 阅读全文
posted @ 2024-02-28 20:38 孟秋十三 阅读(20) 评论(0) 推荐(0)
摘要:EventLoop class EventLoop : noncopyable { public: typedef std::function<void()> Functor; EventLoop(); ~EventLoop(); // force out-line dtor, for std::u 阅读全文
posted @ 2024-02-28 20:37 孟秋十三 阅读(30) 评论(0) 推荐(0)
摘要:Timer 成员变量 const TimerCallback callback_; //定时器到期执行的回调函数 Timestamp expiration_; //表示定时器的到期时间 const double interval_; //表示定时器的时间间隔 const bool repeat_; 阅读全文
posted @ 2024-02-28 20:37 孟秋十三 阅读(11) 评论(0) 推荐(0)
摘要:TimerQueue 成员变量 // FIXME: use unique_ptr<Timer> instead of raw pointers. // This requires heterogeneous comparison lookup (N3465) from C++14 // so tha 阅读全文
posted @ 2024-02-28 20:36 孟秋十三 阅读(20) 评论(0) 推荐(0)