From ecc163f98e434b557768560d00ee2f9755d6d950 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 14 Nov 2018 22:18:59 -0500 Subject: major bug fix --- test/bench_network.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/bench_network.cpp') diff --git a/test/bench_network.cpp b/test/bench_network.cpp index 8ff9ab2..40ba17a 100644 --- a/test/bench_network.cpp +++ b/test/bench_network.cpp @@ -82,17 +82,17 @@ struct MyNet: public MsgNetworkByteOp { MsgNetwork(ec, 10, 1.0, 4096), name(name), peer(peer), - ev_period_stat(ec, -1, 0, [this, stat_timeout](int, short) { + ev_period_stat(ec, -1, [this, stat_timeout](int, short) { printf("%.2f mps\n", nrecv / (double)stat_timeout); nrecv = 0; - ev_period_stat.add_with_timeout(stat_timeout); + ev_period_stat.add_with_timeout(stat_timeout, 0); }), nrecv(0) { /* message handler could be a bound method */ reg_handler(salticidae::generic_bind( &MyNet::on_receive_bytes, this, _1, _2)); if (stat_timeout > 0) - ev_period_stat.add_with_timeout(0); + ev_period_stat.add_with_timeout(0, 0); } struct Conn: public MsgNetworkByteOp::Conn { @@ -109,12 +109,12 @@ struct MyNet: public MsgNetworkByteOp { printf("[%s] Connected, sending hello.\n", net->name.c_str()); /* send the first message through this connection */ - net->ev_period_send = Event(net->ec, -1, 0, + net->ev_period_send = Event(net->ec, -1, [net, conn = self()](int, short) { net->send_msg(MsgBytes(256), *conn); - net->ev_period_send.add_with_timeout(0); + net->ev_period_send.add_with_timeout(0, 0); }); - net->ev_period_send.add_with_timeout(0); + net->ev_period_send.add_with_timeout(0, 0); } else -- cgit v1.2.3