From 39f6d6ac46d440aa68e7b1a2f2e4eb629356af34 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 18 Nov 2018 00:51:19 -0500 Subject: fix bugs --- test/test_network.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/test_network.cpp') diff --git a/test/test_network.cpp b/test/test_network.cpp index e439bca..6a12117 100644 --- a/test/test_network.cpp +++ b/test/test_network.cpp @@ -89,16 +89,16 @@ struct MyNet: public MsgNetworkByteOp { reg_handler(salticidae::generic_bind( &MyNet::on_receive_hello, this, _1, _2)); - reg_conn_handler([this](ConnPool::Conn &conn, bool connected) { + reg_conn_handler([this](const ConnPool::conn_t &conn, bool connected) { if (connected) { - if (conn.get_mode() == ConnPool::Conn::ACTIVE) + if (conn->get_mode() == ConnPool::Conn::ACTIVE) { printf("[%s] Connected, sending hello.\n", this->name.c_str()); /* send the first message through this connection */ send_msg(MsgHello(this->name, "Hello there!"), - static_cast(conn)); + salticidae::static_pointer_cast(conn)); } else printf("[%s] Accepted, waiting for greetings.\n", @@ -108,12 +108,12 @@ struct MyNet: public MsgNetworkByteOp { { printf("[%s] Disconnected, retrying.\n", this->name.c_str()); /* try to reconnect to the same address */ - connect(conn.get_addr()); + connect(conn->get_addr()); } }); } - void on_receive_hello(MsgHello &&msg, MyNet::Conn &conn) { + void on_receive_hello(MsgHello &&msg, const MyNet::conn_t &conn) { printf("[%s] %s says %s\n", name.c_str(), msg.name.c_str(), msg.text.c_str()); @@ -123,8 +123,8 @@ struct MyNet: public MsgNetworkByteOp { }; -void on_receive_ack(MsgAck &&msg, MyNet::Conn &conn) { - auto net = static_cast(conn.get_net()); +void on_receive_ack(MsgAck &&msg, const MyNet::conn_t &conn) { + auto net = static_cast(conn->get_net()); printf("[%s] the peer knows\n", net->name.c_str()); } -- cgit v1.2.3-70-g09d2