socketserver.h

来自「本人收集整理的一份c/c++跨平台网络库」· C头文件 代码 · 共 31 行

H
31
字号
#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 + =
减小字号Ctrl + -
显示快捷键?