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,
std::map<int, caller *> calls_;
std::list<unsigned int> 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);
template<class F, class C=void> 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<class F, class C> void rpcs::reg(unsigned int proc, F f, C *c) {
- reg1(proc, marshalled_func<F, F, ReturnOnFailure>::wrap(f, c));
+ reg1(proc, marshalled_func<F, ReturnOnFailure>::wrap(f, c));
}
void make_sockaddr(const char *hostandport, struct sockaddr_in *dst);