diff options
-rw-r--r-- | fnet/src/examples/frt/rpc/CMakeLists.txt | 8 | ||||
-rw-r--r-- | fnet/src/examples/frt/rpc/rpc_proxy.cpp | 258 | ||||
-rw-r--r-- | fnet/src/tests/examples/examples_test.cpp | 23 | ||||
-rw-r--r-- | fnet/src/tests/frt/rpc/CMakeLists.txt | 11 | ||||
-rw-r--r-- | fnet/src/tests/frt/rpc/session.cpp | 138 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/supervisor.cpp | 127 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/supervisor.h | 30 |
7 files changed, 4 insertions, 591 deletions
diff --git a/fnet/src/examples/frt/rpc/CMakeLists.txt b/fnet/src/examples/frt/rpc/CMakeLists.txt index 7cad990b090..2c04496c8b2 100644 --- a/fnet/src/examples/frt/rpc/CMakeLists.txt +++ b/fnet/src/examples/frt/rpc/CMakeLists.txt @@ -25,14 +25,6 @@ vespa_add_executable(fnet_rpc_info_app DEPENDS fnet ) -vespa_add_executable(fnet_rpc_proxy_app - SOURCES - rpc_proxy.cpp - OUTPUT_NAME vespa-rpc-proxy - INSTALL bin - DEPENDS - fnet -) vespa_add_executable(fnet_rpc_callback_server_app SOURCES rpc_callback_server.cpp diff --git a/fnet/src/examples/frt/rpc/rpc_proxy.cpp b/fnet/src/examples/frt/rpc/rpc_proxy.cpp deleted file mode 100644 index 5e63d675810..00000000000 --- a/fnet/src/examples/frt/rpc/rpc_proxy.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/fnet/frt/supervisor.h> -#include <vespa/fnet/frt/rpcrequest.h> -#include <vespa/fnet/frt/target.h> -#include <vespa/fnet/frt/invoker.h> -#include <vespa/fnet/channel.h> -#include <vespa/fnet/transport_thread.h> -#include <vespa/fnet/transport.h> -#include <vespa/fnet/signalshutdown.h> - -#include <vespa/fastos/app.h> -#include <chrono> - -#include <vespa/log/log.h> -LOG_SETUP("rpc_proxy"); -//----------------------------------------------------------------------------- - -struct Session -{ - FNET_Connection *client; - FRT_Target *server; - uint32_t id; - uint32_t finiCnt; - - explicit Session(uint32_t xid) : client(nullptr), server(nullptr), id(xid), finiCnt(0) {} - ~Session() { assert(client == nullptr && server == nullptr && finiCnt == 2); } - Session(const Session &) = delete; - Session &operator=(const Session &) = delete; -}; - -//----------------------------------------------------------------------------- - -class RPCProxy : public FRT_Invokable -{ -private: - FRT_Supervisor &_supervisor; - const char *_spec; - bool _verbose; - uint32_t _currID; - char _prefixStr[256]; - -public: - RPCProxy(const RPCProxy &) = delete; - RPCProxy &operator=(const RPCProxy &) = delete; - RPCProxy(FRT_Supervisor &supervisor, - const char *spec, - bool verbose) - : _supervisor(supervisor), - _spec(spec), - _verbose(verbose), - _currID(0), - _prefixStr() {} - - bool IsVerbose() const { return _verbose; } - const char *GetPrefix(FRT_RPCRequest *req); - void PrintMethod(FRT_RPCRequest *req, const char *desc); - void Done(FRT_RPCRequest *req); - void HOOK_Mismatch(FRT_RPCRequest *req); - void HOOK_Init(FRT_RPCRequest *req); - void HOOK_Down(FRT_RPCRequest *req); - void HOOK_Fini(FRT_RPCRequest *req); - static Session *GetSession(FRT_RPCRequest *req) - { - return (Session *) req->GetConnection()->GetContext()._value.VOIDP; - } -}; - -//----------------------------------------------------------------------------- - -class ReqDone : public FRT_IRequestWait -{ -private: - RPCProxy &_proxy; - -public: - explicit ReqDone(RPCProxy &proxy) : _proxy(proxy) {} - void RequestDone(FRT_RPCRequest *req) override; -}; - -void -ReqDone::RequestDone(FRT_RPCRequest *req) -{ - _proxy.Done(req); -} - -//----------------------------------------------------------------------------- - -const char * -RPCProxy::GetPrefix(FRT_RPCRequest *req) -{ - tm currTime; - tm *currTimePt; - - using clock = std::chrono::system_clock; - auto now = clock::now(); - auto since = now.time_since_epoch(); - auto secs = std::chrono::duration_cast<std::chrono::seconds>(since); - auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(since - secs); - time_t my_time = clock::to_time_t(now); - - currTimePt = localtime_r(&my_time, &currTime); - assert(currTimePt == &currTime); - (void) currTimePt; - - char rid[32]; - if (req->GetContext()._value.CHANNEL != nullptr) { - sprintf(rid, "[rid=%u]", req->GetContext()._value.CHANNEL->GetID()); - } else { - rid[0] = '\0'; - } - - sprintf(_prefixStr, "[%04d-%02d-%02d %02d:%02d:%02d:%03d][sid=%u]%s", - currTime.tm_year + 1900, - currTime.tm_mon + 1, - currTime.tm_mday, - currTime.tm_hour, - currTime.tm_min, - currTime.tm_sec, - int(ms.count()), - GetSession(req)->id, - rid); - - return _prefixStr; -} - - -void -RPCProxy::PrintMethod(FRT_RPCRequest *req, const char *desc) -{ - fprintf(stdout, "%s %s: %s\n", GetPrefix(req), desc, - req->GetMethodName()); -} - - -void -RPCProxy::Done(FRT_RPCRequest *req) -{ - PrintMethod(req, "RETURN"); - if (IsVerbose()) { - req->GetReturn()->Print(8); - } - req->Return(); -} - - -void -RPCProxy::HOOK_Mismatch(FRT_RPCRequest *req) -{ - PrintMethod(req, "INVOKE"); - if (IsVerbose()) { - req->GetParams()->Print(8); - } - req->Detach(); - req->SetError(FRTE_NO_ERROR, ""); - if (req->GetConnection()->IsServer() && GetSession(req)->server != nullptr) - { - GetSession(req)->server->InvokeAsync(req, 60.0, &req->getStash().create<ReqDone>(*this)); - } else if (req->GetConnection()->IsClient() && GetSession(req)->client != nullptr) - { - FRT_Supervisor::InvokeAsync(GetSession(req)->client->Owner(), GetSession(req)->client, - req, 60.0, &req->getStash().create<ReqDone>(*this)); - } else { - req->SetError(FRTE_RPC_CONNECTION); - req->Return(); - } -} - - -void -RPCProxy::HOOK_Init(FRT_RPCRequest *req) -{ - if (req->GetConnection()->IsClient()) { - return; - } - Session *session = new Session(_currID++); - session->client = req->GetConnection(); - session->server = - _supervisor.Get2WayTarget(_spec, - FNET_Context((void *) session)); - session->client->SetContext(FNET_Context((void *) session)); - if (session->server->GetConnection() == nullptr || - session->server->GetConnection()->GetState() - > FNET_Connection::FNET_CONNECTED) - { - session->finiCnt = 1; - session->client->Owner()->Close(session->client); - } - fprintf(stdout, "%s INIT\n", GetPrefix(req)); -} - - -void -RPCProxy::HOOK_Down(FRT_RPCRequest *req) -{ - Session *session = GetSession(req); - if (req->GetConnection()->IsClient()) { - if (session->client != nullptr) { - session->client->Owner()->Close(session->client); - } - } else { - session->server->SubRef(); - session->client = nullptr; - session->server = nullptr; - } -} - - -void -RPCProxy::HOOK_Fini(FRT_RPCRequest *req) -{ - if (++GetSession(req)->finiCnt == 2) { - fprintf(stdout, "%s FINI\n", GetPrefix(req)); - delete GetSession(req); - } -} - -//----------------------------------------------------------------------------- - -class App : public FastOS_Application -{ -public: - int Main() override; -}; - -int -App::Main() -{ - FNET_SignalShutDown::hookSignals(); - // would like to turn off FNET logging somehow - if (_argc < 3) { - fprintf(stderr, "usage: %s <listenspec> <connectspec> [verbose]\n", _argv[0]); - return 1; - } - bool verbose = (_argc > 3) && (strcmp(_argv[3], "verbose") == 0); - - fnet::frt::StandaloneFRT server; - FRT_Supervisor & supervisor = server.supervisor(); - RPCProxy proxy(supervisor, _argv[2], verbose); - - supervisor.GetReflectionManager()->Reset(); - supervisor.SetSessionInitHook(FRT_METHOD(RPCProxy::HOOK_Init), &proxy); - supervisor.SetSessionDownHook(FRT_METHOD(RPCProxy::HOOK_Down), &proxy); - supervisor.SetSessionFiniHook(FRT_METHOD(RPCProxy::HOOK_Fini), &proxy); - supervisor.SetMethodMismatchHook(FRT_METHOD(RPCProxy::HOOK_Mismatch), &proxy); - supervisor.Listen(_argv[1]); - FNET_SignalShutDown ssd(*supervisor.GetTransport()); - server.supervisor().GetTransport()->WaitFinished(); - return 0; -} - - -int -main(int argc, char **argv) -{ - App app; - return app.Entry(argc, argv); -} diff --git a/fnet/src/tests/examples/examples_test.cpp b/fnet/src/tests/examples/examples_test.cpp index 74271a7ef5c..dc7b051bd80 100644 --- a/fnet/src/tests/examples/examples_test.cpp +++ b/fnet/src/tests/examples/examples_test.cpp @@ -87,10 +87,6 @@ TEST("usage") { ChildProcess proc("exec ../../examples/frt/rpc/fnet_rpc_callback_client_app"); EXPECT_FALSE(runProc(proc, done)); } - { - ChildProcess proc("exec ../../examples/frt/rpc/vespa-rpc-proxy"); - EXPECT_FALSE(runProc(proc, done)); - } } TEST("timeout") { @@ -220,23 +216,4 @@ TEST_MT_F("rpc callback client server", 2, std::atomic<bool>()) { } } -TEST_MT_F("rpc callback client server with proxy", 3, std::atomic<bool>()) { - if (thread_id == 0) { - ChildProcess proc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_callback_server_app tcp/%d", - PORT0).c_str()); - TEST_BARRIER(); - EXPECT_TRUE(runProc(proc, f1)); - } else if (thread_id == 1) { - ChildProcess proc(vespalib::make_string("exec ../../examples/frt/rpc/vespa-rpc-proxy tcp/%d tcp/localhost:%d", - PORT1, PORT0).c_str()); - TEST_BARRIER(); - EXPECT_TRUE(runProc(proc, f1)); - } else { - TEST_BARRIER(); - EXPECT_TRUE(runProc(vespalib::make_string("exec ../../examples/frt/rpc/fnet_rpc_callback_client_app tcp/localhost:%d", - PORT1).c_str())); - f1 = true; - } -} - TEST_MAIN_WITH_PROCESS_PROXY() { TEST_RUN_ALL(); } diff --git a/fnet/src/tests/frt/rpc/CMakeLists.txt b/fnet/src/tests/frt/rpc/CMakeLists.txt index f0155da4b49..64a1d150fce 100644 --- a/fnet/src/tests/frt/rpc/CMakeLists.txt +++ b/fnet/src/tests/frt/rpc/CMakeLists.txt @@ -17,17 +17,6 @@ vespa_add_executable(fnet_detach_return_invoke_test_app TEST fnet ) vespa_add_test(NAME fnet_detach_return_invoke_test_app COMMAND fnet_detach_return_invoke_test_app) -vespa_add_executable(fnet_session_test_app TEST - SOURCES - session.cpp - DEPENDS - fnet -) -vespa_add_test(NAME fnet_session_test_app COMMAND fnet_session_test_app) -vespa_add_test(NAME fnet_session_test_app_xor COMMAND fnet_session_test_app ENVIRONMENT "CRYPTOENGINE=xor") -vespa_add_test(NAME fnet_session_test_app_tls COMMAND fnet_session_test_app ENVIRONMENT "CRYPTOENGINE=tls") -vespa_add_test(NAME fnet_session_test_app_tls_maybe_yes COMMAND fnet_session_test_app ENVIRONMENT "CRYPTOENGINE=tls_maybe_yes") -vespa_add_test(NAME fnet_session_test_app_tls_maybe_no COMMAND fnet_session_test_app ENVIRONMENT "CRYPTOENGINE=tls_maybe_no") vespa_add_executable(fnet_sharedblob_test_app TEST SOURCES sharedblob.cpp diff --git a/fnet/src/tests/frt/rpc/session.cpp b/fnet/src/tests/frt/rpc/session.cpp deleted file mode 100644 index f05cf9dfafc..00000000000 --- a/fnet/src/tests/frt/rpc/session.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/fnet/frt/supervisor.h> -#include <vespa/fnet/frt/target.h> -#include <vespa/fnet/frt/rpcrequest.h> -#include <mutex> - -//------------------------------------------------------------- - -#include "my_crypto_engine.hpp" -vespalib::CryptoEngine::SP crypto; - -//------------------------------------------------------------- - -class Session -{ -private: - static std::mutex _lock; - static int _cnt; - int _val; - -public: - Session() : _val(0) - { - std::lock_guard<std::mutex> guard(_lock); - ++_cnt; - } - - ~Session() - { - std::lock_guard<std::mutex> guard(_lock); - --_cnt; - } - - void SetValue(int val) { _val = val; } - int GetValue() const { return _val; } - static int GetCnt() { return _cnt; } -}; - -std::mutex Session::_lock; -int Session::_cnt(0); - - -struct RPC : public FRT_Invokable -{ - bool bogusFini; - - RPC() : bogusFini(false) {} - - void InitSession(FRT_RPCRequest *req) - { - Session *session = new Session(); - req->GetConnection()->SetContext(FNET_Context((void *) session)); - } - - void FiniSession(FRT_RPCRequest *req) - { - Session *session = - (Session *)req->GetConnection()->GetContext()._value.VOIDP; - bogusFini |= (session == nullptr); - delete session; - } - - void GetValue(FRT_RPCRequest *req) - { - Session *session = - (Session *)req->GetConnection()->GetContext()._value.VOIDP; - req->GetReturn()->AddInt32(session->GetValue()); - } - - void SetValue(FRT_RPCRequest *req) - { - Session *session = - (Session *)req->GetConnection()->GetContext()._value.VOIDP; - session->SetValue(req->GetParams()->GetValue(0)._intval32); - } - - void Init(FRT_Supervisor *s) - { - FRT_ReflectionBuilder rb(s); - rb.DefineMethod("getValue", "", "i", - FRT_METHOD(RPC::GetValue), this); - rb.DefineMethod("setValue", "i", "", - FRT_METHOD(RPC::SetValue), this); - s->SetSessionInitHook(FRT_METHOD(RPC::InitSession), this); - s->SetSessionFiniHook(FRT_METHOD(RPC::FiniSession), this); - } -}; - -void testSession(RPC & rpc) { - fnet::frt::StandaloneFRT frt(crypto); - FRT_Supervisor & orb = frt.supervisor(); - char spec[64]; - rpc.Init(&orb); - ASSERT_TRUE(orb.Listen("tcp/0")); - sprintf(spec, "tcp/localhost:%d", orb.GetListenPort()); - - FRT_Target *target = orb.GetTarget(spec); - FRT_RPCRequest *req = orb.AllocRPCRequest(); - - req->SetMethodName("getValue"); - target->InvokeSync(req, 5.0); - ASSERT_TRUE(!req->IsError() && - strcmp(req->GetReturnSpec(), "i") == 0 && - req->GetReturn()->GetValue(0)._intval32 == 0); - - req = orb.AllocRPCRequest(req); - req->SetMethodName("setValue"); - req->GetParams()->AddInt32(42); - target->InvokeSync(req, 5.0); - ASSERT_TRUE(!req->IsError() && - strcmp(req->GetReturnSpec(), "") == 0); - - req = orb.AllocRPCRequest(req); - req->SetMethodName("getValue"); - target->InvokeSync(req, 5.0); - ASSERT_TRUE(!req->IsError() && - strcmp(req->GetReturnSpec(), "i") == 0 && - req->GetReturn()->GetValue(0)._intval32 == 42); - - EXPECT_TRUE(Session::GetCnt() == 1); - - req->SubRef(); - target->SubRef(); -} -TEST("session") { - RPC rpc; - testSession(rpc); - EXPECT_TRUE(Session::GetCnt() == 0); - EXPECT_TRUE(!rpc.bogusFini); -}; - -TEST_MAIN() { - crypto = my_crypto_engine(); - TEST_RUN_ALL(); - crypto.reset(); -} diff --git a/fnet/src/vespa/fnet/frt/supervisor.cpp b/fnet/src/vespa/fnet/frt/supervisor.cpp index 26402e98ab6..62646350ae9 100644 --- a/fnet/src/vespa/fnet/frt/supervisor.cpp +++ b/fnet/src/vespa/fnet/frt/supervisor.cpp @@ -16,9 +16,7 @@ FRT_Supervisor::FRT_Supervisor(FNET_Transport *transport) _packetStreamer(&_packetFactory), _connector(nullptr), _reflectionManager(), - _rpcHooks(&_reflectionManager), - _connHooks(*this), - _methodMismatchHook() + _rpcHooks(&_reflectionManager) { _rpcHooks.InitRPC(this); } @@ -104,34 +102,6 @@ FRT_Supervisor::AllocRPCRequest(FRT_RPCRequest *tradein) void -FRT_Supervisor::SetSessionInitHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _connHooks.SetSessionInitHook(method, handler); -} - - -void -FRT_Supervisor::SetSessionDownHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _connHooks.SetSessionDownHook(method, handler); -} - - -void -FRT_Supervisor::SetSessionFiniHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _connHooks.SetSessionFiniHook(method, handler); -} - - -void -FRT_Supervisor::SetMethodMismatchHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _methodMismatchHook = std::make_unique<FRT_Method>("frt.hook.methodMismatch", "*", "*", method, handler); -} - - -void FRT_Supervisor::InvokeVoid(FNET_Connection *conn, FRT_RPCRequest *req) { if (conn != nullptr) { @@ -177,9 +147,9 @@ FRT_Supervisor::InvokeSync(SchedulerPtr scheduler, FNET_Connection *conn, FRT_RP bool -FRT_Supervisor::InitAdminChannel(FNET_Channel *channel) +FRT_Supervisor::InitAdminChannel(FNET_Channel *) { - return _connHooks.InitAdminChannel(channel); + return false; } @@ -220,14 +190,6 @@ FRT_Supervisor::HandlePacket(FNET_Packet *packet, FNET_Context context) if (req->IsError()) { - if (req->GetErrorCode() != FRTE_RPC_BAD_REQUEST - && _methodMismatchHook) - { - invoker->ForceMethod(_methodMismatchHook.get()); - return (invoker->Invoke()) ? - FNET_FREE_CHANNEL : FNET_CLOSE_CHANNEL; - } - invoker->HandleDone(false); return FNET_FREE_CHANNEL; @@ -235,6 +197,7 @@ FRT_Supervisor::HandlePacket(FNET_Packet *packet, FNET_Context context) return (invoker->Invoke()) ? FNET_FREE_CHANNEL : FNET_CLOSE_CHANNEL; + } } @@ -319,88 +282,6 @@ FRT_Supervisor::RPCHooks::RPC_GetMethodInfo(FRT_RPCRequest *req) } } -//---------------------------------------------------- -// Connection Hooks -//---------------------------------------------------- - -FRT_Supervisor::ConnHooks::ConnHooks(FRT_Supervisor &parent) - : _parent(parent), - _sessionInitHook(), - _sessionDownHook(), - _sessionFiniHook() -{ -} - - -FRT_Supervisor::ConnHooks::~ConnHooks() = default; - -void -FRT_Supervisor::ConnHooks::SetSessionInitHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _sessionInitHook = std::make_unique<FRT_Method>("frt.hook.sessionInit", "", "", method, handler); -} - - -void -FRT_Supervisor::ConnHooks::SetSessionDownHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _sessionDownHook = std::make_unique<FRT_Method>("frt.hook.sessionDown", "", "", method, handler); -} - - -void -FRT_Supervisor::ConnHooks::SetSessionFiniHook(FRT_METHOD_PT method, FRT_Invokable *handler) -{ - _sessionFiniHook = std::make_unique<FRT_Method>("frt.hook.sessionFini", "", "", method, handler); -} - - -void -FRT_Supervisor::ConnHooks::InvokeHook(FRT_Method *hook, FNET_Connection *conn) -{ - FRT_RPCRequest *req = _parent.AllocRPCRequest(); - req->SetMethodName(hook->GetName()); - req->getStash().create<FRT_HookInvoker>(req, hook, conn).Invoke(); -} - - -bool -FRT_Supervisor::ConnHooks::InitAdminChannel(FNET_Channel *channel) -{ - FNET_Connection *conn = channel->GetConnection(); - conn->SetCleanupHandler(this); - if (_sessionInitHook) { - InvokeHook(_sessionInitHook.get(), conn); - } - channel->SetHandler(this); - channel->SetContext(channel); - return true; -} - - -FNET_IPacketHandler::HP_RetCode -FRT_Supervisor::ConnHooks::HandlePacket(FNET_Packet *packet, FNET_Context context) -{ - if (!packet->IsChannelLostCMD()) { - packet->Free(); - return FNET_KEEP_CHANNEL; - } - FNET_Channel *ch = context._value.CHANNEL; - if (_sessionDownHook) { - InvokeHook(_sessionDownHook.get(), ch->GetConnection()); - } - return FNET_FREE_CHANNEL; -} - - -void -FRT_Supervisor::ConnHooks::Cleanup(FNET_Connection *conn) -{ - if (_sessionFiniHook) { - InvokeHook(_sessionFiniHook.get(), conn); - } -} - FRT_Supervisor::SchedulerPtr::SchedulerPtr(FNET_Transport *transport) : ptr(transport->GetScheduler()) { } diff --git a/fnet/src/vespa/fnet/frt/supervisor.h b/fnet/src/vespa/fnet/frt/supervisor.h index a97385adfed..c02a68d1f85 100644 --- a/fnet/src/vespa/fnet/frt/supervisor.h +++ b/fnet/src/vespa/fnet/frt/supervisor.h @@ -42,29 +42,6 @@ public: void RPC_GetMethodInfo(FRT_RPCRequest *req); }; - class ConnHooks : public FNET_IConnectionCleanupHandler, - public FNET_IPacketHandler - { - private: - FRT_Supervisor &_parent; - std::unique_ptr<FRT_Method> _sessionInitHook; - std::unique_ptr<FRT_Method> _sessionDownHook; - std::unique_ptr<FRT_Method> _sessionFiniHook; - public: - ConnHooks(const ConnHooks &) = delete; - ConnHooks &operator=(const ConnHooks &) = delete; - explicit ConnHooks(FRT_Supervisor &parent); - ~ConnHooks() override; - - void SetSessionInitHook(FRT_METHOD_PT method, FRT_Invokable *handler); - void SetSessionDownHook(FRT_METHOD_PT method, FRT_Invokable *handler); - void SetSessionFiniHook(FRT_METHOD_PT method, FRT_Invokable *handler); - void InvokeHook(FRT_Method *hook, FNET_Connection *conn); - bool InitAdminChannel(FNET_Channel *channel); - HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override; - void Cleanup(FNET_Connection *conn) override; - }; - private: FNET_Transport *_transport; FRT_PacketFactory _packetFactory; @@ -72,7 +49,6 @@ private: FNET_Connector *_connector; FRT_ReflectionManager _reflectionManager; RPCHooks _rpcHooks; - ConnHooks _connHooks; std::unique_ptr<FRT_Method> _methodMismatchHook; public: @@ -94,12 +70,6 @@ public: FRT_Target *GetTarget(int port); FRT_RPCRequest *AllocRPCRequest(FRT_RPCRequest *tradein = nullptr); - // special hooks (implemented as RPC methods) - void SetSessionInitHook(FRT_METHOD_PT method, FRT_Invokable *handler); - void SetSessionDownHook(FRT_METHOD_PT method, FRT_Invokable *handler); - void SetSessionFiniHook(FRT_METHOD_PT method, FRT_Invokable *handler); - void SetMethodMismatchHook(FRT_METHOD_PT method, FRT_Invokable *handler); - struct SchedulerPtr { FNET_Scheduler *ptr; SchedulerPtr(FNET_Scheduler *scheduler) |