This commit is contained in:
azw 2023-04-15 08:05:53 +00:00
parent dd650c0bca
commit 0f16fe1513
2 changed files with 6 additions and 6 deletions

View File

@ -152,9 +152,4 @@ namespace a8
}
void UdpListener::OnRecvUdpPacket(UdpPacket* pkt)
{
}
}

View File

@ -1,5 +1,10 @@
#pragma once
#include <arpa/inet.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <netinet/tcp.h>
namespace a8
{
struct UdpPacket
@ -14,6 +19,7 @@ namespace a8
{
public:
std::function<void (a8::UdpListener*, int error_id)> on_error;
std::function<void (a8::UdpListener*, UdpPacket*)> on_recv_packet;
std::string bind_address;
unsigned short bind_port = 0;
@ -25,7 +31,6 @@ namespace a8
void Close();
bool IsActive();
virtual void SendUdpPacket(UdpPacket* pkt);
virtual void OnRecvUdpPacket(UdpPacket* pkt);
private:
a8::UdpListenerImpl* impl_ = nullptr;