From 39f6d6ac46d440aa68e7b1a2f2e4eb629356af34 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 18 Nov 2018 00:51:19 -0500 Subject: fix bugs --- include/salticidae/conn.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/salticidae/conn.h') diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index 69402d3..c357875 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -63,7 +63,7 @@ class ConnPool { /** The handle to a bi-directional connection. */ using conn_t = ArcObj; /** The type of callback invoked when connection status is changed. */ - using conn_callback_t = std::function; + using conn_callback_t = std::function; /** Abstraction for a bi-directional connection. */ class Conn { friend ConnPool; @@ -168,7 +168,7 @@ class ConnPool { void update_conn(const conn_t &conn, bool connected) { user_tcall->async_call([this, conn, connected](ThreadCall::Handle &) { - if (conn_cb) conn_cb(*conn, connected); + if (conn_cb) conn_cb(conn, connected); }); } @@ -391,9 +391,7 @@ class ConnPool { template void reg_conn_handler(Func cb) { conn_cb = cb; } - void terminate(Conn &_conn) { - auto conn = _conn.self(); - if (!conn) return; + void terminate(const conn_t &conn) { disp_tcall->async_call([this, conn](ThreadCall::Handle &) { conn->disp_terminate(); }); -- cgit v1.2.3