aboutsummaryrefslogtreecommitdiff
path: root/test/test_p2p_stress.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-11-18 21:52:35 -0500
committerDeterminant <[email protected]>2018-11-18 21:52:35 -0500
commit35ffa2c1e5c7fba06c52e2c20aff2aac910921d5 (patch)
tree7adcea80aac36059811df618901ca38e656e282c /test/test_p2p_stress.cpp
parentcff8386147356176228b8c56573005bca2b65d0a (diff)
...
Diffstat (limited to 'test/test_p2p_stress.cpp')
-rw-r--r--test/test_p2p_stress.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/test_p2p_stress.cpp b/test/test_p2p_stress.cpp
index e4120b9..cc61948 100644
--- a/test/test_p2p_stress.cpp
+++ b/test/test_p2p_stress.cpp
@@ -147,11 +147,15 @@ int main(int argc, char **argv) {
auto opt_npeers = Config::OptValInt::create(5);
auto opt_seg_buff_size = Config::OptValInt::create(4096);
auto opt_nworker = Config::OptValInt::create(2);
+ auto opt_conn_timeout = Config::OptValDouble::create(5);
+ auto opt_ping_peroid = Config::OptValDouble::create(5);
auto opt_help = Config::OptValFlag::create(false);
config.add_opt("no-msg", opt_no_msg, Config::SWITCH_ON);
config.add_opt("npeers", opt_npeers, Config::SET_VAL);
config.add_opt("seg-buff-size", opt_seg_buff_size, Config::SET_VAL);
config.add_opt("nworker", opt_nworker, Config::SET_VAL);
+ config.add_opt("conn-timeout", opt_conn_timeout, Config::SET_VAL);
+ config.add_opt("ping-period", opt_ping_peroid, Config::SET_VAL);
config.add_opt("help", opt_help, Config::SWITCH_ON, 'h', "show this help info");
config.parse(argc, argv);
if (opt_help->get())
@@ -171,8 +175,10 @@ int main(int argc, char **argv) {
a.addr = addrs[i];
a.net = new MyNet(a.ec, MyNet::Config(
salticidae::ConnPool::Config()
- .nworker(opt_nworker->get()).seg_buff_size(seg_buff_size))
- .conn_timeout(5).ping_period(2));
+ .nworker(opt_nworker->get())
+ .seg_buff_size(seg_buff_size))
+ .conn_timeout(opt_conn_timeout->get())
+ .ping_period(opt_ping_peroid->get()));
a.tcall = new ThreadCall(a.ec);
if (!opt_no_msg->get())
install_proto(a.ec, *a.net, a.tc, seg_buff_size);