cond c;
};
- void get_refconn(connection **ch);
+ void get_refconn(shared_ptr<connection> & ch);
void update_xid_rep(int xid);
bool retrans_;
bool reachable_;
- connection *chan_;
+ shared_ptr<connection> chan_;
mutex m_; // protect insert/delete to calls[]
mutex chan_m_;
void cancel();
- bool got_pdu(connection *c, const string & b);
+ bool got_pdu(const shared_ptr<connection> & c, const string & b);
template<class R, typename ...Args>
inline int call(proc_t proc, R & r, const Args&... args);
void updatestat(proc_t proc);
// latest connection to the client
- map<unsigned int, connection *> conns_;
+ map<unsigned int, shared_ptr<connection>> conns_;
// counting
const size_t counting_;
protected:
- struct djob_t {
- connection *conn;
- string buf;
- };
- void dispatch(djob_t *);
+ void dispatch(shared_ptr<connection> c, const string & buf);
// internal handler registration
void reg1(proc_t proc, handler *);
void set_reachable(bool r) { reachable_ = r; }
- bool got_pdu(connection *c, const string & b);
+ bool got_pdu(const shared_ptr<connection> & c, const string & b);
struct ReturnOnFailure {
static inline int unmarshall_args_failure() {