![]() |
Kea 3.1.7
|
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. | |
UDP client class.
Copied from TcpClient with UDP specific parts moved from RadiusImpl.
| isc::radius::UdpClient::UdpClient | ( | const asiolink::IOServicePtr & | io_service, |
| unsigned | thread_pool_size = 0 ) |
Constructor.
| 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().
| isc::radius::UdpClient::~UdpClient | ( | ) |
| void isc::radius::UdpClient::checkPermissions | ( | ) |
Check if the current thread can perform thread pool state transition.
| 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().
| const asiolink::IOServicePtr isc::radius::UdpClient::getThreadIOService | ( | ) | const |
| unsigned isc::radius::UdpClient::getThreadPoolSize | ( | ) | const |
| void isc::radius::UdpClient::pause | ( | ) |
Pauses the client's thread pool.
| 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().
| void isc::radius::UdpClient::registerExchange | ( | ExchangePtr | exchange | ) |
| void isc::radius::UdpClient::resume | ( | ) |
Resumes running the client's thread pool.
| 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().
| 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.
| 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().
| void isc::radius::UdpClient::unregisterExchange | ( | ExchangePtr | exchange | ) |