mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Adds ConnectionInfo to Rpc callback (#116)
This commit is contained in:
committed by
Peter Johnson
parent
9047c98e68
commit
a7eca7d4bd
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user