diff --git a/include/fc/json_rpc_connection.hpp b/include/fc/json_rpc_connection.hpp index 8bebdfb..34a93ca 100644 --- a/include/fc/json_rpc_connection.hpp +++ b/include/fc/json_rpc_connection.hpp @@ -25,7 +25,6 @@ namespace fc { namespace json { template struct pending_result_impl : virtual public promise, virtual public pending_result { virtual void handle_result( const fc::value& s ) { - slog( "cast %s", typeid(T).name() ); this->set_value( value_cast(s) ); } protected: diff --git a/include/fc/ptr.hpp b/include/fc/ptr.hpp index 3af839c..92f0165 100644 --- a/include/fc/ptr.hpp +++ b/include/fc/ptr.hpp @@ -6,15 +6,9 @@ namespace fc { namespace detail { struct identity_member { - // TODO: enumerate all method patterns - template - static fc::function functor( P&& p, R (C::*mem_func)() ) { - return [=](){ return (p->*mem_func)(); }; - } - - template - static fc::function functor( P&& p, R (C::*mem_func)(A1) ) { - return fc::function([=](A1 a1){ return (p->*mem_func)(a1); }); + template + static fc::function functor( P&& p, R (C::*mem_func)(Args...) ) { + return fc::function([=](Args... args){ return (p->*mem_func)(args...); }); } }; diff --git a/src/json_rpc_connection.cpp b/src/json_rpc_connection.cpp index 2854473..34bcdb7 100644 --- a/src/json_rpc_connection.cpp +++ b/src/json_rpc_connection.cpp @@ -140,6 +140,7 @@ namespace fc { namespace json { void rpc_connection::invoke( detail::pending_result::ptr&& p, const fc::string& m, value&& param ) { + p->id = my->_next_req_id; if( my->_pr_tail ) { my->_pr_tail->next = p; my->_pr_tail = my->_pr_tail->next; diff --git a/tests/json_rpc_test.cpp b/tests/json_rpc_test.cpp index 72a4fff..f54522c 100644 --- a/tests/json_rpc_test.cpp +++ b/tests/json_rpc_test.cpp @@ -10,7 +10,7 @@ struct test { int sub(int x){ return x-1; } int sub1(int x){ return 3; } int sub2(float x){ return 3; } - int sub3(double x){ return 3; } + int sub3(double x, int y){ return x-y; } int sub4(uint16_t x){ return 3; } int sub5(char x){ return 3; } int sub6(uint64_t x){ return 3; } @@ -37,6 +37,7 @@ int main( int argc, char** argv ) { fc::json::rpc_client rpcc( con ); slog( "5+1=%d", rpcc->add(5).wait() ); + slog( "sub3 4-5=%d", rpcc->sub3(4,5).wait() ); } slog( "exit serv" ); /*