class srv {
public:
int handle_22(string & r, const string a, const string b);
- int handle_fast(int &r, const int a);
- int handle_slow(int &r, const int a);
- int handle_bigrep(string &r, const size_t a);
+ int handle_fast(int & r, const int a);
+ int handle_slow(int & r, const int a);
+ int handle_bigrep(string & r, const size_t a);
};
namespace srv_protocol {
// rpcs::reg() decides how to unmarshall by looking
// at these argument types, so this function definition
// does what a .x file does in SunRPC.
-int srv::handle_22(string &r, const string a, string b) {
+int srv::handle_22(string & r, const string a, string b) {
r = a + b;
return 0;
}
-int srv::handle_fast(int &r, const int a) {
+int srv::handle_fast(int & r, const int a) {
r = a + 1;
return 0;
}
-int srv::handle_slow(int &r, const int a) {
+int srv::handle_slow(int & r, const int a) {
usleep(random() % 500);
r = a + 2;
return 0;
}
-int srv::handle_bigrep(string &r, const size_t len) {
+int srv::handle_bigrep(string & r, const size_t len) {
r = string(len, 'x');
return 0;
}