📄 asyncpacketsocket.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 + -