📄 physicalsocketserver.h
字号:
#ifndef UTILS_BASE_PHYSICALSOCKETSERVER_H_#define UTILS_BASE_PHYSICALSOCKETSERVER_H_#include <vector>#include "asyncfile.h"#include "socketserver.h"#include "criticalsection.h"#ifdef POSIXtypedef int SOCKET;#endif // POSIXnamespace utils_base { class Dispatcher;class Signaler;// A socket server that provides the real sockets of the underlying OS.class PhysicalSocketServer : public SocketServer {public: PhysicalSocketServer(); virtual ~PhysicalSocketServer(); // SocketFactory: virtual Socket* CreateSocket(int type); virtual AsyncSocket* CreateAsyncSocket(int type); // Internal Factory for Accept AsyncSocket* WrapSocket(SOCKET s); // SocketServer: virtual bool Wait(int cms, bool process_io); virtual void WakeUp(); void Add(Dispatcher* dispatcher); void Remove(Dispatcher* dispatcher);#ifdef POSIX AsyncFile* CreateFile(int fd);#endifprivate: std::vector<Dispatcher*> dispatchers_; Signaler* signal_wakeup_; CriticalSection crit_; bool fWait_; uint32 last_tick_tracked_; int last_tick_dispatch_count_;};} // namespace utils_base#endif // UTILS_BASE_PHYSICALSOCKETSERVER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -