Kea: isc::radius::UdpClient Class Reference

| Kea 3.2.0-git

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.
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.

## 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_service | IO service to be used by the UDP client.
  thread_pool_size | maximum 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 36 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 56 of file radius.cc.

References stop().

Here is the call graph for this function:

## Member Function Documentation

## ◆ checkPermissions()

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

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

Exceptions

  MultiThreadingInvalidOperation | if the state transition is done on any of the worker threads.

Definition at line 100 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 66 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 61 of file radius.cc.

## ◆ pause()

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

Pauses the client's thread pool.

Exceptions

  InvalidOperation | if the thread pool does not exist.

Definition at line 120 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

  exchange | The exchange to register.

Definition at line 149 of file radius.cc.

## ◆ resume()

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

Resumes running the client's thread pool.

Exceptions

  InvalidOperation | if the thread pool does not exist.

Definition at line 135 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 71 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 81 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

  exchange | The exchange to unregister.

Definition at line 155 of file radius.cc.

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

- radius.h
- radius.cc