-
Notifications
You must be signed in to change notification settings - Fork 133
Compilation and installation options
By default, the make install
command will install the library globally in your system (/usr/lib
for example).
You can change that location by using a dedicated cmake option:
cmake -DCMAKE_INSTALL_PREFIX=/destination/path ..
By default, select()
timeout is set to NULL (unlimited timeout), meaning that select will sleep indefinitely until a notification is received.
If this behavior is not desirable, you can configure the select()
timeout at runtime by using the CMake variable SELECT_TIMEOUT
and setting it with a nano-seconds duration.
# Configure select timeout
cmake .. -DSELECT_TIMEOUT=1000000L
By default, all lines of code related to logging are suppressed at the preprocessing step.
This is done to provide higher performance by avoiding the execution of unnecessary lines of code related to logging even though no logger has been configured.
If you wish to enable logging, you have to disable that default behavior by setting the CMake variable LOGGING_ENABLED
.
# Enable logging
cmake .. -DLOGGING_ENABLED=1
The tcp_client is multithreaded: multiple workers are in charge of executing the read and write callbacks once the data has been written to or read from the underlying socket. All tcp_client share the same default thread pool returned by utils::get_default_thread_pool
, except if it has been overridden by tcp_client::set_thread_pool
.
You can configure the number of workers assigned to the tcp_client by setting the DEFAULT_THREAD_POOL_SIZE
CMake variable.
# Change the number of io_service workers (default value: 1)
cmake .. -DDEFAULT_THREAD_POOL_SIZE=1
TCP Server is initialized is a maximum queue size of incoming connections.
You can configure this queue size by setting the CONNECTION_QUEUE_SIZE
CMake variable.
# Change the queue size (default value: 1024)
cmake .. -DCONNECTION_QUEUE_SIZE=1024
cmake .. -DBUILD_TESTS=true
cmake .. -DBUILD_EXAMPLES=true
Need more information? Contact me.