⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asyncpacketsocket.h

📁 本人收集整理的一份c/c++跨平台网络库
💻 H
字号:
#ifndef UTILS_BASE_ASYNCPACKETSOCKET_H_#define UTILS_BASE_ASYNCPACKETSOCKET_H_#include "asyncsocket.h"namespace utils_base {// Provides the ability to receive packets asynchronously.  Sends are not// buffered since it is acceptable to drop packets under high load.class AsyncPacketSocket : public sigslot::has_slots<> {public:  AsyncPacketSocket(AsyncSocket* socket);  virtual ~AsyncPacketSocket();  // Relevant socket methods:  virtual SocketAddress GetLocalAddress() const;  virtual SocketAddress GetRemoteAddress() const;  virtual int Bind(const SocketAddress& addr);  virtual int Connect(const SocketAddress& addr);  virtual int Send(const void *pv, size_t cb);  virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr);  virtual int Close();  virtual int SetOption(Socket::Option opt, int value);  virtual int GetError() const;  virtual void SetError(int error);  // Emitted each time a packet is read.  sigslot::signal4<const char*, size_t, const SocketAddress&, AsyncPacketSocket*> SignalReadPacket;protected:  AsyncSocket* socket_;};} // namespace utils_base#endif // UTILS_BASE_ASYNCPACKETSOCKET_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -