📄 socketserver.h
字号:
#ifndef UTILS_BASE_SOCKETSERVER_H_#define UTILS_BASE_SOCKETSERVER_H_#include "socketfactory.h"namespace utils_base {const int kForever = -1;// Provides the ability to wait for activity on a set of sockets. The Thread// class provides a nice wrapper on a socket server.//// The server is also a socket factory. The sockets it creates will be// notified of asynchronous I/O from this server's Wait method.class SocketServer : public SocketFactory {public: // Sleeps until: // 1) cms milliseconds have elapsed (unless cms == kForever) // 2) WakeUp() is called // While sleeping, I/O is performed if process_io is true. virtual bool Wait(int cms, bool process_io) = 0; // Causes the current wait (if one is in progress) to wake up. virtual void WakeUp() = 0;};} // namespace utils_base#endif // UTILS_BASE_SOCKETSERVER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -