Kea 3.3.1
isc::radius::UdpClient Class Reference

UDP client class. More...

#include <radius.h>

Public Member Functions

 UdpClient (const asiolink::IOServicePtr &io_service, unsigned thread_pool_size=0)
 Constructor.
 ~UdpClient ()
 Destructor.
bool checkExchangeListRoom ()
 Check Exchange List Room.
void checkPermissions ()
 Check if the current thread can perform thread pool state transition.
const asiolink::IOServicePtr getThreadIOService () const
 Fetches a pointer to the internal IOService used to drive the thread-pool in multi-threaded mode.
unsigned getThreadPoolSize () const
 Fetches the maximum size of the thread pool.
void pause ()
 Pauses the client's thread pool.
void registerExchange (ExchangePtr exchange)
 Register Exchange.
void resume ()
 Resumes running the client's thread pool.
void start ()
 Starts running the client's thread pool, if multi-threaded.
void stop ()
 Halts client-side IO activity.
void unregisterExchange (ExchangePtr exchange)
 Unregister Exchange.

Static Public Attributes

static size_t exchangeListMaxSize = 200
 Exchange List Maximum Size (currently the max(200,soft_limit/2)).

Detailed Description

UDP client class.

Copied from TcpClient with UDP specific parts moved from RadiusImpl.

Definition at line 39 of file radius.h.

Constructor & Destructor Documentation

◆ UdpClient()

isc::radius::UdpClient::UdpClient ( const asiolink::IOServicePtr & io_service,
unsigned thread_pool_size = 0 )

Constructor.

Parameters
io_serviceIO service to be used by the UDP client.
thread_pool_sizemaximum number of threads in the thread pool. The value 0 means that MT is disabled. deferred until a subsequent call to start().

Definition at line 59 of file radius.cc.

References isc::util::MultiThreadingMgr::addCriticalSectionCallbacks(), checkPermissions(), isc::util::MultiThreadingMgr::instance(), pause(), and resume().

Here is the call graph for this function:

◆ ~UdpClient()

isc::radius::UdpClient::~UdpClient ( )

Destructor.

Definition at line 79 of file radius.cc.

References stop().

Here is the call graph for this function:

Member Function Documentation

◆ checkExchangeListRoom()

bool isc::radius::UdpClient::checkExchangeListRoom ( )

Check Exchange List Room.

Returns
True is enough room is available in the exchange list, false otherwise.

Definition at line 184 of file radius.cc.

References exchangeListMaxSize.

◆ checkPermissions()

void isc::radius::UdpClient::checkPermissions ( )

Check if the current thread can perform thread pool state transition.

Exceptions
MultiThreadingInvalidOperationif the state transition is done on any of the worker threads.

Definition at line 123 of file radius.cc.

References LOG_ERROR, isc::radius::radius_logger, isc::radius::RADIUS_PAUSE_ILLEGAL, isc::radius::RADIUS_PAUSE_PERMISSIONS_FAILED, and isc::Exception::what().

Referenced by UdpClient().

Here is the call graph for this function:

◆ getThreadIOService()

const asiolink::IOServicePtr isc::radius::UdpClient::getThreadIOService ( ) const

Fetches a pointer to the internal IOService used to drive the thread-pool in multi-threaded mode.

Returns
pointer to the IOService instance, or an empty pointer in single-threaded mode.

Definition at line 89 of file radius.cc.

◆ getThreadPoolSize()

unsigned isc::radius::UdpClient::getThreadPoolSize ( ) const

Fetches the maximum size of the thread pool.

Returns
the maximum size of the thread pool.

Definition at line 84 of file radius.cc.

◆ pause()

void isc::radius::UdpClient::pause ( )

Pauses the client's thread pool.

Exceptions
InvalidOperationif the thread pool does not exist.

Definition at line 143 of file radius.cc.

References LOG_ERROR, isc::radius::radius_logger, and isc::radius::RADIUS_PAUSE_FAILED.

Referenced by UdpClient().

◆ registerExchange()

void isc::radius::UdpClient::registerExchange ( ExchangePtr exchange)

Register Exchange.

Parameters
exchangeThe exchange to register.

Definition at line 172 of file radius.cc.

◆ resume()

void isc::radius::UdpClient::resume ( )

Resumes running the client's thread pool.

Exceptions
InvalidOperationif the thread pool does not exist.

Definition at line 158 of file radius.cc.

References LOG_ERROR, isc::radius::radius_logger, and isc::radius::RADIUS_RESUME_FAILED.

Referenced by UdpClient().

◆ start()

void isc::radius::UdpClient::start ( )

Starts running the client's thread pool, if multi-threaded.

Definition at line 94 of file radius.cc.

References LOG_INFO, isc::radius::radius_logger, and isc::radius::RADIUS_THREAD_POOL_STARTED.

◆ stop()

void isc::radius::UdpClient::stop ( )

Halts client-side IO activity.

Shutdown all exchanges, In multi-threaded mode discards the thread-pool and the internal IOService.

Definition at line 104 of file radius.cc.

References isc::util::MultiThreadingMgr::instance(), and isc::util::MultiThreadingMgr::removeCriticalSectionCallbacks().

Referenced by ~UdpClient().

Here is the call graph for this function:

◆ unregisterExchange()

void isc::radius::UdpClient::unregisterExchange ( ExchangePtr exchange)

Unregister Exchange.

Parameters
exchangeThe exchange to unregister.

Definition at line 178 of file radius.cc.

Member Data Documentation

◆ exchangeListMaxSize

size_t isc::radius::UdpClient::exchangeListMaxSize = 200
static

The documentation for this class was generated from the following files: