Kea 2.7.6
|
A receiving DHCP packets class. More...
#include <receiver.h>
Public Member Functions | |
Receiver (BasePerfSocket &socket, bool single_threaded, uint8_t ip_version) | |
Receiver constructor. | |
~Receiver () | |
Destructor. | |
dhcp::PktPtr | getPkt () |
Get DHCP packet. | |
void | start () |
Start a receiving thread in multi-thread mode. | |
void | stop () |
Stop a receiving thread in multi-thread mode. | |
A receiving DHCP packets class.
Receiver can be used in two modes: single-thread and multi-thread.
In single-thread mode the class directly reads packets from socket and returns them to consumer using getPkt method.
In case of multi-thread mode the class starts a thread in the background. The thread reads the packets and pushes them to pkt_queue_. Then in main thread packets can be consumed from the queue using getPkt method.
Definition at line 34 of file receiver.h.
|
inline |
Receiver constructor.
socket | A socket for receiving packets. |
single_threaded | A flag indicating running mode. |
ip_version | An IP version: 4 or 6 |
Definition at line 61 of file receiver.h.
isc::perfdhcp::Receiver::~Receiver | ( | ) |
Destructor.
Definition at line 49 of file receiver.cc.
References stop().
PktPtr isc::perfdhcp::Receiver::getPkt | ( | ) |
Get DHCP packet.
In single-thread mode it reads directly from the socket. In multi-thread mode it reads packets from the queue.
Definition at line 58 of file receiver.cc.
Referenced by isc::perfdhcp::TestControl::consumeReceivedPackets().
void isc::perfdhcp::Receiver::start | ( | ) |
Start a receiving thread in multi-thread mode.
In single-thread mode it does nothing.
Definition at line 24 of file receiver.cc.
References isc_throw.
Referenced by isc::perfdhcp::TestControl::start().
void isc::perfdhcp::Receiver::stop | ( | ) |
Stop a receiving thread in multi-thread mode.
In single-thread mode it does nothing.
Definition at line 36 of file receiver.cc.
Referenced by ~Receiver(), and isc::perfdhcp::TestControl::stop().