aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/salticidae/conn.h15
-rw-r--r--include/salticidae/network.h19
-rw-r--r--test/test_p2p_stress.cpp3
3 files changed, 19 insertions, 18 deletions
diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h
index 4e2f0f9..9afc813 100644
--- a/include/salticidae/conn.h
+++ b/include/salticidae/conn.h
@@ -359,12 +359,9 @@ class ConnPool {
class Config {
friend class ConnPool;
- template<typename OpcodeType> friend class MsgNetwork;
int _max_listen_backlog;
double _conn_server_timeout;
size_t _seg_buff_size;
- size_t _max_msg_size;
- size_t _max_msg_queue_size;
size_t _max_recv_buff_size;
size_t _nworker;
size_t _queue_capacity;
@@ -381,8 +378,6 @@ class ConnPool {
_max_listen_backlog(10),
_conn_server_timeout(2),
_seg_buff_size(4096),
- _max_msg_size(1024),
- _max_msg_queue_size(65536),
_max_recv_buff_size(4096),
_nworker(1),
_queue_capacity(0),
@@ -409,16 +404,6 @@ class ConnPool {
return *this;
}
- Config &max_msg_size(size_t x) {
- _max_msg_size = x;
- return *this;
- }
-
- Config &max_msg_queue_size(size_t x) {
- _max_msg_queue_size = x;
- return *this;
- }
-
Config &max_recv_buff_size(size_t x) {
_max_recv_buff_size = x;
return *this;
diff --git a/include/salticidae/network.h b/include/salticidae/network.h
index 18f3a42..3ecffe7 100644
--- a/include/salticidae/network.h
+++ b/include/salticidae/network.h
@@ -155,13 +155,28 @@ class MsgNetwork: public ConnPool {
public:
class Config: public ConnPool::Config {
- friend MsgNetwork;
+ friend class MsgNetwork;
+ size_t _max_msg_size;
+ size_t _max_msg_queue_size;
size_t _burst_size;
public:
Config(): Config(ConnPool::Config()) {}
Config(const ConnPool::Config &config):
- ConnPool::Config(config), _burst_size(1000) {}
+ ConnPool::Config(config),
+ _max_msg_size(1024),
+ _max_msg_queue_size(65536),
+ _burst_size(1000) {}
+
+ Config &max_msg_size(size_t x) {
+ _max_msg_size = x;
+ return *this;
+ }
+
+ Config &max_msg_queue_size(size_t x) {
+ _max_msg_queue_size = x;
+ return *this;
+ }
Config &burst_size(size_t x) {
_burst_size = x;
diff --git a/test/test_p2p_stress.cpp b/test/test_p2p_stress.cpp
index e4341bb..4e16e30 100644
--- a/test/test_p2p_stress.cpp
+++ b/test/test_p2p_stress.cpp
@@ -225,7 +225,8 @@ int main(int argc, char **argv) {
.nworker(opt_nworker->get())
.seg_buff_size(seg_buff_size))
.conn_timeout(opt_conn_timeout->get())
- .ping_period(opt_ping_peroid->get()));
+ .ping_period(opt_ping_peroid->get())
+ .max_msg_size(65536));
a.tcall = new ThreadCall(a.ec);
if (!opt_no_msg->get())
install_proto(a, seg_buff_size);