This repository was archived by the owner on Apr 6, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
includes/cpp_redis/network Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,20 @@ set_target_properties(${PROJECT}
65
65
PROPERTIES
66
66
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /target" )
67
67
68
+ IF (CPP_REDIS_READ_SIZE )
69
+ set_target_properties (${PROJECT}
70
+ PROPERTIES
71
+ COMPILE_DEFINITIONS "CPP_REDIS_READ_SIZE=${CPP_REDIS_READ_SIZE} " )
72
+ ENDIF (CPP_REDIS_READ_SIZE )
73
+
68
74
69
75
###
70
76
# install
71
77
###
72
78
install (TARGETS ${PROJECT} DESTINATION lib )
73
79
install (DIRECTORY ${CPP_REDIS_INCLUDES} / DESTINATION include )
74
80
81
+
75
82
###
76
83
# examples
77
84
###
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ cmake .. # only library
21
21
cmake .. -DBUILD_TESTS=true # library and tests
22
22
cmake .. -DBUILD_EXAMPLES=true # library and examples
23
23
cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true # library, tests and examples
24
+ cmake .. -DCPP_REDIS_READ_SIZE=4096 # Change the read size used to read data from sockets (default: 4096)
24
25
make -j
25
26
```
26
27
Original file line number Diff line number Diff line change 10
10
#include " cpp_redis/network/io_service.hpp"
11
11
#include " cpp_redis/redis_error.hpp"
12
12
13
+ #ifndef CPP_REDIS_READ_SIZE
14
+ # define CPP_REDIS_READ_SIZE 4096
15
+ #endif /* CPP_REDIS_READ_SIZE */
16
+
13
17
namespace cpp_redis {
14
18
15
19
namespace network {
@@ -60,7 +64,7 @@ class tcp_client {
60
64
std::atomic_bool m_is_connected;
61
65
62
66
// ! buffers
63
- static const unsigned int READ_SIZE = 2048 ;
67
+ static const unsigned int READ_SIZE = CPP_REDIS_READ_SIZE ;
64
68
std::vector<char > m_read_buffer;
65
69
std::vector<char > m_write_buffer;
66
70
You can’t perform that action at this time.
0 commit comments