You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int getKeyCodeStatus(const int nKeyCode, KEYVALUE &emKeyValue){
#ifndef __NOREST_RPC
rest_rpc::rpc_client &m_rpcClient = getBoardRpcClient();
int nRetValue = 0;
if (!m_rpcClient.has_connected()) {
程序异常时报错如下:
#0 0xb6a0ee22 in rest_rpc::rpc_client::call_back(unsigned long long, boost::system::error_code const&, boost::basic_string_view<char, std::char_traits >) () from /mnt/data/hwt_rk3308/lib/libbtl.so
#1 0xb6a139ca in boost::asio::detail::read_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::any_io_executor>, boost::asio::mutable_buffers_1, boost::asio::mutable_buffer const*, boost::asio::detail::transfer_all_t, rest_rpc::rpc_client::read_body(unsigned long long, rest_rpc::request_type, unsigned int)::{lambda(boost::system::error_code, unsigned int)#1}>::operator()(boost::system::error_code, unsigned int, int) () from /mnt/data/hwt_rk3308/lib/libbtl.so
#2 0xb6a14950 in boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::asio::detail::read_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::any_io_executor>, boost::asio::mutable_buffers_1, boost::asio::mutable_buffer const*, boost::asio::detail::transfer_all_t, rest_rpc::rpc_client::read_body(unsigned long long, rest_rpc::request_type, unsigned int)::{lambda(boost::system::error_code, unsigned int)#1}>, boost::asio::any_io_executor>::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned int) ()
from /mnt/data/hwt_rk3308/lib/libbtl.so
#3 0xb6a0c286 in boost::asio::detail::scheduler::run(boost::system::error_code&) () from /mnt/data/hwt_rk3308/lib/libbtl.so
#4 0xb6a16df8 in std::thread::_State_impl<std::_Bind_simple<rest_rpc::rpc_client::rpc_client()::{lambda()#1} ()> >::_M_run() () from /mnt/data/hwt_rk3308/lib/libbtl.so
#5 0xb69257a0 in ?? () from /usr/lib/libstdc++.so.6
#6 0xb6a385ce in ?? () from /lib/libpthread.so.0
用法是在libbtl库中使用rpc创建客户端提供接口,另外有一个服务端,客户端接口代码如下:
rest_rpc::rpc_client& getBoardRpcClient(const std::string &host, int port) {
static rest_rpc::rpc_client m_rpcBoardClient;
if (m_rpcBoardClient.has_connected()) {
return m_rpcBoardClient;
}
m_rpcBoardClient.enable_auto_heartbeat(); // automatic heartbeat
m_rpcBoardClient.connect(host, port, false, 60); // 60s
return m_rpcBoardClient;
}
int getKeyCodeStatus(const int nKeyCode, KEYVALUE &emKeyValue){
#ifndef __NOREST_RPC
rest_rpc::rpc_client &m_rpcClient = getBoardRpcClient();
int nRetValue = 0;
if (!m_rpcClient.has_connected()) {
The text was updated successfully, but these errors were encountered: