From d2fe5eb74bdf40afc5cacd052f40b56aa3e57eaf Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 20 Nov 2018 20:43:57 -0500 Subject: refactor libuv wrapper classes --- test/test_p2p_stress.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/test_p2p_stress.cpp') diff --git a/test/test_p2p_stress.cpp b/test/test_p2p_stress.cpp index b272742..70e3444 100644 --- a/test/test_p2p_stress.cpp +++ b/test/test_p2p_stress.cpp @@ -36,7 +36,7 @@ using salticidae::NetAddr; using salticidae::DataStream; using salticidae::MsgNetwork; using salticidae::ConnPool; -using salticidae::Event; +using salticidae::TimerEvent; using salticidae::EventContext; using salticidae::htole; using salticidae::letoh; @@ -78,7 +78,7 @@ using MyNet = salticidae::PeerNetwork; std::vector addrs; struct TestContext { - Event timer; + TimerEvent timer; int state; uint256_t hash; size_t ncompleted; @@ -130,7 +130,7 @@ void install_proto(AppContext &app, const size_t &seg_buff_size) { { send_rand(tc.state, conn); tc.state = -1; - tc.timer = Event(ec, -1, [&, conn](int, int) { + tc.timer = TimerEvent(ec, [&, conn](TimerEvent &) { tc.ncompleted++; net.terminate(conn); std::string s; @@ -139,7 +139,7 @@ void install_proto(AppContext &app, const size_t &seg_buff_size) { SALTICIDAE_LOG_INFO("%d completed:%s", ntohs(app.addr.port), s.c_str()); }); double t = salticidae::gen_rand_timeout(10); - tc.timer.add_with_timeout(t, 0); + tc.timer.add(t); SALTICIDAE_LOG_INFO("rand-bomboard phase, ending in %.2f secs", t); } else if (tc.state == -1) -- cgit v1.2.3