Adds ConnectionInfo to Rpc callback (#116)

This commit is contained in:
Thad House
2016-10-03 10:04:30 -07:00
committed by Peter Johnson
parent 9047c98e68
commit a7eca7d4bd
8 changed files with 48 additions and 15 deletions

View File

@@ -41,7 +41,8 @@ class RpcServer {
void ProcessRpc(StringRef name, std::shared_ptr<Message> msg,
RpcCallback func, unsigned int conn_id,
SendMsgFunc send_response);
SendMsgFunc send_response,
const ConnectionInfo& conn_info);
bool PollRpc(bool blocking, RpcCallInfo* call_info);
bool PollRpc(bool blocking, double time_out, RpcCallInfo* call_info);
@@ -56,18 +57,21 @@ class RpcServer {
struct RpcCall {
RpcCall(StringRef name_, std::shared_ptr<Message> msg_, RpcCallback func_,
unsigned int conn_id_, SendMsgFunc send_response_)
unsigned int conn_id_, SendMsgFunc send_response_,
const ConnectionInfo conn_info_)
: name(name_),
msg(msg_),
func(func_),
conn_id(conn_id_),
send_response(send_response_) {}
send_response(send_response_),
conn_info(conn_info_) {}
std::string name;
std::shared_ptr<Message> msg;
RpcCallback func;
unsigned int conn_id;
SendMsgFunc send_response;
ConnectionInfo conn_info;
};
std::mutex m_mutex;