![]() |
Kea 3.3.3
|
TcpClient implementation. More...
Public Member Functions | |
| TcpClientImpl (const IOServicePtr &io_service, size_t thread_pool_size=0, bool defer_thread_start=false) | |
| Constructor. | |
| ~TcpClientImpl () | |
| Destructor. | |
| void | checkPermissions () |
| Check if the current thread can perform thread pool state transition. | |
| uint16_t | getThreadCount () |
| Fetches the number of threads in the pool. | |
| asiolink::IOServicePtr | getThreadIOService () |
| Fetches the internal IOService used in multi-threaded mode. | |
| uint16_t | getThreadPoolSize () |
| Fetches the maximum size of the thread pool. | |
| bool | isPaused () |
| Indicates if the thread pool is paused. | |
| bool | isRunning () |
| Indicates if the thread pool is running. | |
| bool | isStopped () |
| Indicates if the thread pool is stopped. | |
| void | pause () |
| Pauses the client's thread pool. | |
| void | resume () |
| Resumes running the client's thread pool. | |
| void | start () |
| Starts running the client's thread pool, if multi-threaded. | |
| void | stop () |
| Close all connections, and if multi-threaded, stops the client's thread pool. | |
Public Attributes | |
| ConnectionPoolPtr | conn_pool_ |
| Holds a pointer to the connection pool. | |
TcpClient implementation.
Definition at line 1874 of file tcp_client.cc.
|
inline |
Constructor.
If single-threading:
| io_service | IOService that will drive connection IO in single threaded mode. (Currently ignored in multi-threaded mode) |
| thread_pool_size | maximum number of concurrent threads Internally this also sets the maximum number of concurrent connections per address. |
| defer_thread_start | When true, starting of the pool threads is deferred until a subsequent call to start(). In this case the pool's operational state after construction is STOPPED. Otherwise, the thread pool threads will be created and started, with the operational state being RUNNING. Applicable only when thread-pool size is greater than zero. |
Definition at line 1899 of file tcp_client.cc.
References conn_pool_, isc::log::DBGLVL_TRACE_BASIC, LOG_DEBUG, isc::tcp::TCP_CLIENT_MT_STARTED, and isc::tcp::tcp_logger.
|
inline |
Destructor.
Calls stop().
Definition at line 1927 of file tcp_client.cc.
References stop().
|
inline |
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 1936 of file tcp_client.cc.
|
inline |
Fetches the number of threads in the pool.
Definition at line 2046 of file tcp_client.cc.
|
inline |
Fetches the internal IOService used in multi-threaded mode.
Definition at line 2032 of file tcp_client.cc.
|
inline |
Fetches the maximum size of the thread pool.
Definition at line 2039 of file tcp_client.cc.
|
inline |
Indicates if the thread pool is paused.
Definition at line 2020 of file tcp_client.cc.
|
inline |
Indicates if the thread pool is running.
Definition at line 1996 of file tcp_client.cc.
|
inline |
Indicates if the thread pool is stopped.
Definition at line 2008 of file tcp_client.cc.
|
inline |
Pauses the client's thread pool.
Suspends thread pool event processing.
| InvalidOperation | if the thread pool does not exist. |
Definition at line 1970 of file tcp_client.cc.
References isc_throw.
|
inline |
Resumes running the client's thread pool.
Resumes thread pool event processing.
| InvalidOperation | if the thread pool does not exist. |
Definition at line 1983 of file tcp_client.cc.
References isc_throw.
|
inline |
Starts running the client's thread pool, if multi-threaded.
Definition at line 1943 of file tcp_client.cc.
|
inline |
Close all connections, and if multi-threaded, stops the client's thread pool.
Definition at line 1951 of file tcp_client.cc.
References conn_pool_.
Referenced by ~TcpClientImpl().
| ConnectionPoolPtr isc::tcp::TcpClientImpl::conn_pool_ |
Holds a pointer to the connection pool.
Definition at line 2054 of file tcp_client.cc.
Referenced by TcpClientImpl(), and stop().