X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/4b9798f44ae94deabf87dd534337b55259272950..b86bce0900f88c530f23dd602a8f2ef9ce008f8a:/rpc/rpc.h diff --git a/rpc/rpc.h b/rpc/rpc.h index 245f277..20a0aa9 100644 --- a/rpc/rpc.h +++ b/rpc/rpc.h @@ -27,12 +27,6 @@ class rpc_const { static const int cancel_failure = -7; }; -struct ReturnOnFailure { - static inline int unmarshall_args_failure() { - return rpc_const::unmarshal_args_failure; - } -}; - // rpc client endpoint. // manages a xid space per destination socket // threaded: multiple threads can be sending RPCs, @@ -76,16 +70,16 @@ class rpcc : public chanmgr { std::map calls_; std::list xid_rep_window_; - - struct request { - request() { clear(); } - void clear() { buf.clear(); xid = -1; } - bool isvalid() { return xid != -1; } - std::string buf; - int xid; - }; - struct request dup_req_; - int xid_rep_done_; + + struct request { + request() { clear(); } + void clear() { buf.clear(); xid = -1; } + bool isvalid() { return xid != -1; } + std::string buf; + int xid; + }; + struct request dup_req_; + int xid_rep_done_; public: rpcc(sockaddr_in d, bool retrans=true); @@ -258,8 +252,14 @@ class rpcs : public chanmgr { template void reg(unsigned int proc, F f, C *c=nullptr); }; +struct ReturnOnFailure { + static inline int unmarshall_args_failure() { + return rpc_const::unmarshal_args_failure; + } +}; + template void rpcs::reg(unsigned int proc, F f, C *c) { - reg1(proc, marshalled_func::wrap(f, c)); + reg1(proc, marshalled_func::wrap(f, c)); } void make_sockaddr(const char *hostandport, struct sockaddr_in *dst);