X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/3abd3952c1f4441f0dd6eae9883b2d01ed9cd56b..3615d9bf0b254442e2fddee45475dbd634cf703a:/rpc/rpc.h diff --git a/rpc/rpc.h b/rpc/rpc.h index 19ec96a..9ec2fd8 100644 --- a/rpc/rpc.h +++ b/rpc/rpc.h @@ -45,7 +45,7 @@ class rpcc : public chanmgr { cond c; }; - void get_refconn(connection **ch); + void get_refconn(shared_ptr & ch); void update_xid_rep(int xid); @@ -58,7 +58,7 @@ class rpcc : public chanmgr { bool retrans_; bool reachable_; - connection *chan_; + shared_ptr chan_; mutex m_; // protect insert/delete to calls[] mutex chan_m_; @@ -95,7 +95,7 @@ class rpcc : public chanmgr { void cancel(); - bool got_pdu(connection *c, const string & b); + bool got_pdu(const shared_ptr & c, const string & b); template inline int call(proc_t proc, R & r, const Args&... args); @@ -175,7 +175,7 @@ class rpcs : public chanmgr { void updatestat(proc_t proc); // latest connection to the client - map conns_; + map> conns_; // counting const size_t counting_; @@ -195,11 +195,7 @@ class rpcs : public chanmgr { protected: - struct djob_t { - connection *conn; - string buf; - }; - void dispatch(djob_t *); + void dispatch(shared_ptr c, const string & buf); // internal handler registration void reg1(proc_t proc, handler *); @@ -216,7 +212,7 @@ class rpcs : public chanmgr { void set_reachable(bool r) { reachable_ = r; } - bool got_pdu(connection *c, const string & b); + bool got_pdu(const shared_ptr & c, const string & b); struct ReturnOnFailure { static inline int unmarshall_args_failure() {