asyncpacketsocket.h

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

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