This source file includes following definitions.
- out_fifo_
- ReadRXPacket_Locked
- WriteRXPacket_Locked
- ReadTXPacket_Locked
- WriteTXPacket_Locked
#include "nacl_io/socket/udp_event_emitter.h"
#include "sdk_util/auto_lock.h"
namespace nacl_io {
UdpEventEmitter::UdpEventEmitter(size_t rsize, size_t wsize)
: in_fifo_(rsize), out_fifo_(wsize) {
UpdateStatus_Locked();
}
Packet* UdpEventEmitter::ReadRXPacket_Locked() {
Packet* packet = in_fifo_.ReadPacket();
UpdateStatus_Locked();
return packet;
}
void UdpEventEmitter::WriteRXPacket_Locked(Packet* packet) {
in_fifo_.WritePacket(packet);
UpdateStatus_Locked();
}
Packet* UdpEventEmitter::ReadTXPacket_Locked() {
Packet* packet = out_fifo_.ReadPacket();
UpdateStatus_Locked();
return packet;
}
void UdpEventEmitter::WriteTXPacket_Locked(Packet* packet) {
out_fifo_.WritePacket(packet);
UpdateStatus_Locked();
}
}