1
This commit is contained in:
parent
a6f06f65b2
commit
03f5f63a42
@ -15,7 +15,9 @@
|
||||
#include <a8/a8.h>
|
||||
#include <a8/udplistener.h>
|
||||
|
||||
#if 0
|
||||
#include <f8/udplog.h>
|
||||
#endif
|
||||
|
||||
namespace a8
|
||||
{
|
||||
@ -116,12 +118,14 @@ namespace a8
|
||||
(struct sockaddr*)&from_addr,
|
||||
(socklen_t*)&addr_len);
|
||||
if(ret > 0) {
|
||||
#if 0
|
||||
f8::UdpLog::Instance()->Debug("recvfrom host:%s port:%d buflen:%d",
|
||||
{
|
||||
inet_ntoa(from_addr.sin_addr),
|
||||
from_addr.sin_port,
|
||||
ret
|
||||
});
|
||||
#endif
|
||||
a8::UdpPacket* pkt = new a8::UdpPacket();
|
||||
pkt->buf = (char*)malloc(ret + 1);
|
||||
memmove((void*)pkt->buf, recv_buf, ret);
|
||||
@ -129,10 +133,12 @@ namespace a8
|
||||
pkt->remote_addr = from_addr;
|
||||
master->on_recv_packet(pkt);
|
||||
} else {
|
||||
#if 0
|
||||
f8::UdpLog::Instance()->Debug("recvfrom error ret:%d",
|
||||
{
|
||||
ret
|
||||
});
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user