diff options
author | Håvard Pettersen <havardpe@oath.com> | 2022-03-24 14:13:23 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2022-03-24 14:13:23 +0000 |
commit | 1e5ea8890c73112e6e6f3fbecf4850ee2671e5b5 (patch) | |
tree | c2fc4e8d3f59ec7ad6fdb14893063bd3aaa5f424 /fnet | |
parent | 7d8808a32d70cbf17a45059b4541e350307c01dd (diff) |
remove admin channel concept
Diffstat (limited to 'fnet')
-rw-r--r-- | fnet/CMakeLists.txt | 1 | ||||
-rw-r--r-- | fnet/src/examples/ping/pingserver.cpp | 1 | ||||
-rw-r--r-- | fnet/src/examples/proxy/.gitignore | 4 | ||||
-rw-r--r-- | fnet/src/examples/proxy/CMakeLists.txt | 7 | ||||
-rw-r--r-- | fnet/src/examples/proxy/proxy.cpp | 249 | ||||
-rw-r--r-- | fnet/src/tests/connect/connect_test.cpp | 5 | ||||
-rw-r--r-- | fnet/src/tests/connection_spread/connection_spread_test.cpp | 1 | ||||
-rw-r--r-- | fnet/src/tests/examples/examples_test.cpp | 23 | ||||
-rw-r--r-- | fnet/src/tests/info/info.cpp | 2 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/connection.cpp | 58 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/connection.h | 22 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/supervisor.cpp | 10 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/supervisor.h | 1 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/iserveradapter.h | 26 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport.cpp | 4 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport.h | 12 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport_thread.cpp | 4 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport_thread.h | 12 |
18 files changed, 13 insertions, 429 deletions
diff --git a/fnet/CMakeLists.txt b/fnet/CMakeLists.txt index f73db1f34f8..8b21777a3d5 100644 --- a/fnet/CMakeLists.txt +++ b/fnet/CMakeLists.txt @@ -12,7 +12,6 @@ vespa_define_module( TESTS src/examples/frt/rpc src/examples/ping - src/examples/proxy src/examples/timeout src/tests/connect src/tests/connection_spread diff --git a/fnet/src/examples/ping/pingserver.cpp b/fnet/src/examples/ping/pingserver.cpp index 6e8cc081d34..83d99c9c7e8 100644 --- a/fnet/src/examples/ping/pingserver.cpp +++ b/fnet/src/examples/ping/pingserver.cpp @@ -17,7 +17,6 @@ class PingServer : public FNET_IServerAdapter, public FastOS_Application { public: - bool InitAdminChannel(FNET_Channel *) override { return false; } bool InitChannel(FNET_Channel *channel, uint32_t) override { channel->SetContext(FNET_Context(channel)); channel->SetHandler(this); diff --git a/fnet/src/examples/proxy/.gitignore b/fnet/src/examples/proxy/.gitignore deleted file mode 100644 index a2ec3289ec2..00000000000 --- a/fnet/src/examples/proxy/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.depend -Makefile -proxy -fnet_proxy_app diff --git a/fnet/src/examples/proxy/CMakeLists.txt b/fnet/src/examples/proxy/CMakeLists.txt deleted file mode 100644 index 6c72c56d20b..00000000000 --- a/fnet/src/examples/proxy/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(fnet_proxy_app - SOURCES - proxy.cpp - DEPENDS - fnet -) diff --git a/fnet/src/examples/proxy/proxy.cpp b/fnet/src/examples/proxy/proxy.cpp deleted file mode 100644 index 153b2499b93..00000000000 --- a/fnet/src/examples/proxy/proxy.cpp +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/fnet/transport.h> -#include <vespa/fnet/transport_thread.h> -#include <vespa/fnet/connection.h> -#include <vespa/fnet/signalshutdown.h> -#include <vespa/fnet/packet.h> -#include <vespa/fnet/iserveradapter.h> -#include <vespa/fnet/ipacketstreamer.h> -#include <vespa/fnet/channel.h> -#include <vespa/fnet/connector.h> -#include <vespa/fastos/app.h> - -#include <vespa/log/log.h> -LOG_SETUP("proxy"); - -class RawPacket : public FNET_Packet -{ -private: - FNET_DataBuffer _data; - -public: - RawPacket() : _data() {} - uint32_t GetPCODE() override; - uint32_t GetLength() override; - void Encode(FNET_DataBuffer *) override; - bool Decode(FNET_DataBuffer *src, uint32_t len) override; -}; - -uint32_t -RawPacket::GetPCODE() -{ - return 0; -} - -uint32_t -RawPacket::GetLength() -{ - return _data.GetDataLen(); -} - -void -RawPacket::Encode(FNET_DataBuffer *dst) -{ - dst->WriteBytes(_data.GetData(), _data.GetDataLen()); -} - -bool -RawPacket::Decode(FNET_DataBuffer *src, uint32_t len) -{ - _data.WriteBytes(src->GetData(), len); - src->DataToDead(len); - return true; -} - - -class Bridge : public FNET_IPacketHandler -{ -private: - FNET_Channel *_client; - FNET_Connection *_server; - - Bridge(const Bridge &); - Bridge &operator=(const Bridge &); - -public: - Bridge() : _client(nullptr), _server(nullptr) {} - - enum packet_source { - CLIENT = 0, - SERVER = 1 - }; - - void SetConns(FNET_Channel *client, - FNET_Connection *server) - { - _client = client; - _server = server; - } - - HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override; -}; - - -FNET_IPacketHandler::HP_RetCode -Bridge::HandlePacket(FNET_Packet *packet, FNET_Context context) -{ - HP_RetCode ret = FNET_KEEP_CHANNEL; - - if (packet->IsChannelLostCMD()) { - - if (context._value.INT == CLIENT) { - - if (_server != nullptr) { - LOG(info, "client connection lost"); - _server->Owner()->Close(_server); - } - ret = FNET_FREE_CHANNEL; - _client = nullptr; - - } else if (context._value.INT == SERVER) { - - if (_client != nullptr) { - LOG(info, "server connection lost"); - _client->GetConnection()->Owner()->Close(_client->GetConnection()); - } - _server->SubRef(); - _server = nullptr; - - } - - if (_client == nullptr && _server == nullptr) - delete this; - - } else { - - if (context._value.INT == CLIENT) { - if (_server != nullptr) - _server->PostPacket(packet, FNET_NOID); - else - packet->Free(); - - } else if (context._value.INT == SERVER) { - if (_client != nullptr) - _client->Send(packet); - else - packet->Free(); - - } - } - - // The admin channel on a client connection (in this case, the - // connection with the server) are freed when the connection - // object is destructed. The admin channel on a server connection - // however (in this case the channel connecting us with the - // client) must be treated as a normal channel. - - return ret; -} - - -class Proxy : public FNET_IServerAdapter, - public FNET_IPacketStreamer, - public FastOS_Application -{ -private: - FNET_Transport _transport; - -public: - Proxy() : _transport() {} - ~Proxy() override { } - bool GetPacketInfo(FNET_DataBuffer *src, uint32_t *plen, uint32_t *pcode, uint32_t *chid, bool *) override; - FNET_Packet *Decode(FNET_DataBuffer *src, uint32_t plen, uint32_t pcode, FNET_Context) override; - void Encode(FNET_Packet *packet, uint32_t chid, FNET_DataBuffer *dst) override; - // --------------------------------------------- - bool InitAdminChannel(FNET_Channel *channel) override; - bool InitChannel(FNET_Channel *, uint32_t) override; - // --------------------------------------------- - int Main() override; -}; - - -bool -Proxy::GetPacketInfo(FNET_DataBuffer *src, uint32_t *plen, - uint32_t *pcode, uint32_t *chid, bool *) -{ - if (src->GetDataLen() == 0) { - return false; - } - *pcode = 0; - *plen = src->GetDataLen(); - *chid = FNET_NOID; - return true; -} - -FNET_Packet * -Proxy::Decode(FNET_DataBuffer *src, uint32_t plen, - uint32_t, FNET_Context) -{ - RawPacket *packet = new RawPacket(); - packet->Decode(src, plen); - return packet; -} - -void -Proxy::Encode(FNET_Packet *packet, uint32_t chid, - FNET_DataBuffer *dst) -{ - uint32_t pcode = packet->GetPCODE(); - uint32_t len = packet->GetLength(); - (void) pcode; - (void) chid; - (void) len; - packet->Encode(dst); -} - -// --------------------------------------------- - -bool -Proxy::InitAdminChannel(FNET_Channel *channel) -{ - Bridge *bridge = new Bridge(); - FNET_Connection *server = _transport.Connect(_argv[2], this, bridge, - FNET_Context(Bridge::SERVER)); - if (server == nullptr) { - channel->GetConnection()->Owner()->Close(channel->GetConnection()); - delete bridge; - return false; - } - bridge->SetConns(channel, server); - channel->SetHandler(bridge); - channel->SetContext(FNET_Context((uint32_t)Bridge::CLIENT)); - return true; -} - -bool -Proxy::InitChannel(FNET_Channel *, uint32_t) -{ - return false; -} - -// --------------------------------------------- - -int -Proxy::Main() -{ - FNET_SignalShutDown::hookSignals(); - if (_argc != 3) { - fprintf(stderr, "usage: %s <listen spec> <target spec>\n", _argv[0]); - return 1; - } - - FNET_Connector *listener = - _transport.Listen(_argv[1], this, this); - if (listener != nullptr) - listener->SubRef(); - - FNET_SignalShutDown ssd(_transport); - _transport.Main(); - return 0; -} - - -int -main(int argc, char **argv) -{ - Proxy myapp; - return myapp.Entry(argc, argv); -} diff --git a/fnet/src/tests/connect/connect_test.cpp b/fnet/src/tests/connect/connect_test.cpp index 2edb2e694ff..1a96da8cd5f 100644 --- a/fnet/src/tests/connect/connect_test.cpp +++ b/fnet/src/tests/connect/connect_test.cpp @@ -117,8 +117,11 @@ struct TransportFixture : FNET_IPacketHandler, FNET_IConnectionCleanupHandler { } void Cleanup(FNET_Connection *) override { conn_deleted.countDown(); } FNET_Connection *connect(const vespalib::string &spec) { - FNET_Connection *conn = transport.Connect(spec.c_str(), &streamer, this); + FNET_Connection *conn = transport.Connect(spec.c_str(), &streamer); ASSERT_TRUE(conn != nullptr); + if (conn->OpenChannel(this, FNET_Context()) == nullptr) { + conn_lost.countDown(); + } conn->SetCleanupHandler(this); return conn; } diff --git a/fnet/src/tests/connection_spread/connection_spread_test.cpp b/fnet/src/tests/connection_spread/connection_spread_test.cpp index 1d19bcb2401..f1eac229c89 100644 --- a/fnet/src/tests/connection_spread/connection_spread_test.cpp +++ b/fnet/src/tests/connection_spread/connection_spread_test.cpp @@ -16,7 +16,6 @@ using namespace std::literals; struct DummyAdapter : FNET_IServerAdapter { - bool InitAdminChannel(FNET_Channel *) override { return false; } bool InitChannel(FNET_Channel *, uint32_t) override { return false; } }; diff --git a/fnet/src/tests/examples/examples_test.cpp b/fnet/src/tests/examples/examples_test.cpp index b6476311adb..a6c1afc04dd 100644 --- a/fnet/src/tests/examples/examples_test.cpp +++ b/fnet/src/tests/examples/examples_test.cpp @@ -58,7 +58,6 @@ bool run_with_retry(const vespalib::string &cmd) { } TEST("usage") { - EXPECT_FALSE(Process::run("exec ../../examples/proxy/fnet_proxy_app")); EXPECT_FALSE(Process::run("exec ../../examples/ping/fnet_pingserver_app")); EXPECT_FALSE(Process::run("exec ../../examples/ping/fnet_pingclient_app")); EXPECT_FALSE(Process::run("exec ../../examples/frt/rpc/fnet_rpc_client_app")); @@ -107,28 +106,6 @@ TEST_MT_F("ping times out", 2, pid_t(-1)) { } } -TEST_MT_FF("ping with proxy", 3, pid_t(-1), pid_t(-1)) { - if (thread_id == 0) { - Process proc(fmt("exec ../../examples/ping/fnet_pingserver_app tcp/%d", - PORT0), true); - f1 = proc.pid(); - TEST_BARRIER(); - TEST_DO(consume_result(proc)); - } else if (thread_id == 1) { - Process proc(fmt("exec ../../examples/proxy/fnet_proxy_app tcp/%d tcp/localhost:%d", - PORT1, PORT0), true); - f2 = proc.pid(); - TEST_BARRIER(); - TEST_DO(consume_result(proc)); - } else { - TEST_BARRIER(); - EXPECT_TRUE(run_with_retry(fmt("exec ../../examples/ping/fnet_pingclient_app tcp/localhost:%d", - PORT1))); - kill(f1, SIGTERM); - kill(f2, SIGTERM); - } -} - TEST_MT_F("rpc client server", 2, pid_t(-1)) { if (thread_id == 0) { Process proc(fmt("exec ../../examples/frt/rpc/fnet_rpc_server_app tcp/%d", diff --git a/fnet/src/tests/info/info.cpp b/fnet/src/tests/info/info.cpp index 4271546e647..0d4e0f90a09 100644 --- a/fnet/src/tests/info/info.cpp +++ b/fnet/src/tests/info/info.cpp @@ -80,7 +80,7 @@ TEST("size of important objects") EXPECT_EQUAL(MUTEX_SIZE + sizeof(std::string) + 112u, sizeof(FNET_IOComponent)); EXPECT_EQUAL(32u, sizeof(FNET_Channel)); EXPECT_EQUAL(40u, sizeof(FNET_PacketQueue_NoLock)); - EXPECT_EQUAL(MUTEX_SIZE + sizeof(std::string) + 416u, sizeof(FNET_Connection)); + EXPECT_EQUAL(MUTEX_SIZE + sizeof(std::string) + 408u, sizeof(FNET_Connection)); EXPECT_EQUAL(48u, sizeof(std::condition_variable)); EXPECT_EQUAL(56u, sizeof(FNET_DataBuffer)); EXPECT_EQUAL(8u, sizeof(FNET_Context)); diff --git a/fnet/src/vespa/fnet/connection.cpp b/fnet/src/vespa/fnet/connection.cpp index e3259db848b..c5849e28d93 100644 --- a/fnet/src/vespa/fnet/connection.cpp +++ b/fnet/src/vespa/fnet/connection.cpp @@ -148,14 +148,9 @@ FNET_Connection::SetState(State state) } if ( ! toDelete.empty() ) { - FNET_Channel *ach = _adminChannel; - for (const FNET_Channel::UP & ch : toDelete) { - if (ch.get() == ach) { - _adminChannel = nullptr; - } else { - SubRef_NoLock(); - } + (void) ch; + SubRef_NoLock(); } } } @@ -189,11 +184,7 @@ FNET_Connection::HandlePacket(uint32_t plen, uint32_t pcode, _channels.Unregister(channel); if (hp_rc == FNET_IPacketHandler::FNET_FREE_CHANNEL) { - if (channel == _adminChannel) { - _adminChannel = nullptr; - } else { - SubRef_NoLock(); - } + SubRef_NoLock(); toDelete.reset(channel); } } @@ -480,7 +471,6 @@ FNET_Connection::FNET_Connection(FNET_TransportThread *owner, : FNET_IOComponent(owner, socket.get(), spec, /* time-out = */ true), _streamer(streamer), _serverAdapter(serverAdapter), - _adminChannel(nullptr), _socket(owner->owner().create_server_crypto_socket(std::move(socket))), _resolve_handler(nullptr), _context(), @@ -507,14 +497,11 @@ FNET_Connection::FNET_Connection(FNET_TransportThread *owner, FNET_Connection::FNET_Connection(FNET_TransportThread *owner, FNET_IPacketStreamer *streamer, FNET_IServerAdapter *serverAdapter, - FNET_IPacketHandler *adminHandler, - FNET_Context adminContext, FNET_Context context, const char *spec) : FNET_IOComponent(owner, -1, spec, /* time-out = */ true), _streamer(streamer), _serverAdapter(serverAdapter), - _adminChannel(nullptr), _socket(), _resolve_handler(nullptr), _context(context), @@ -533,21 +520,12 @@ FNET_Connection::FNET_Connection(FNET_TransportThread *owner, _callbackTarget(nullptr), _cleanup(nullptr) { - if (adminHandler != nullptr) { - FNET_Channel::UP admin(new FNET_Channel(FNET_NOID, this, adminHandler, adminContext)); - _adminChannel = admin.get(); - _channels.Register(admin.release()); - } _num_connections.fetch_add(1, std::memory_order_relaxed); } FNET_Connection::~FNET_Connection() { - if (_adminChannel != nullptr) { - _channels.Unregister(_adminChannel); - delete _adminChannel; - } assert(_cleanup == nullptr); _num_connections.fetch_sub(1, std::memory_order_relaxed); } @@ -560,20 +538,6 @@ FNET_Connection::Init() EnableReadEvent(true); EnableWriteEvent(true); - // init server admin channel - if (CanAcceptChannels() && _adminChannel == nullptr) { - FNET_Channel::UP ach(new FNET_Channel(FNET_NOID, this)); - if (_serverAdapter->InitAdminChannel(ach.get())) { - AddRef_NoLock(); - _channels.Register(ach.release()); - } - } - - // handle close by admin channel init - if (GetState() == FNET_CLOSED) { - return false; - } - // initiate async resolve if (IsClient()) { _resolve_handler = std::make_shared<ResolveHandler>(this); @@ -675,22 +639,6 @@ FNET_Connection::CloseAndFreeChannel(FNET_Channel *channel) } -void -FNET_Connection::CloseAdminChannel() -{ - FNET_Channel::UP toDelete; - std::unique_lock<std::mutex> guard(_ioc_lock); - if (_adminChannel != nullptr) { - WaitCallback(guard, _adminChannel); - if (_adminChannel != nullptr) { - _channels.Unregister(_adminChannel); - toDelete.reset(_adminChannel); - _adminChannel = nullptr; - } - } -} - - bool FNET_Connection::PostPacket(FNET_Packet *packet, uint32_t chid) { diff --git a/fnet/src/vespa/fnet/connection.h b/fnet/src/vespa/fnet/connection.h index af4483e23e5..1a5e8be0198 100644 --- a/fnet/src/vespa/fnet/connection.h +++ b/fnet/src/vespa/fnet/connection.h @@ -96,7 +96,6 @@ private: using ResolveHandlerSP = std::shared_ptr<ResolveHandler>; FNET_IPacketStreamer *_streamer; // custom packet streamer FNET_IServerAdapter *_serverAdapter; // only on server side - FNET_Channel *_adminChannel; // only on client side vespalib::CryptoSocket::UP _socket; // socket for this conn ResolveHandlerSP _resolve_handler; // async resolve callback FNET_Context _context; // connection context @@ -266,16 +265,12 @@ public: * @param owner the TransportThread object serving this connection * @param streamer custom packet streamer * @param serverAdapter object for custom channel creation - * @param adminHandler packet handler for admin channel - * @param adminContext context for admin channel * @param context initial context for this connection * @param spec connect spec **/ FNET_Connection(FNET_TransportThread *owner, FNET_IPacketStreamer *streamer, FNET_IServerAdapter *serverAdapter, - FNET_IPacketHandler *adminHandler, - FNET_Context adminContext, FNET_Context context, const char *spec); @@ -445,23 +440,6 @@ public: /** - * Close the admin channel on a client connection. Invoking this - * method on connections in the server aspect will have no effect. - * - * This method is needed because on the client side the application - * does not own the actual admin channel object. The admin channel - * on server-side connections are handled as normal channels. - * - * After this method returns, no more packets will be delivered to - * the admin packet handler. In other words: this method is used to - * make the connection loose the reference to the admin packet - * handler in a thread-safe way, enabling the admin packet handler - * to be deleted or the like. - **/ - void CloseAdminChannel(); - - - /** * Post a packet on the output queue. Note that the packet will not * be sent if the connection is in CLOSING or CLOSED state. NOTE: * packet handover (caller TO invoked object). diff --git a/fnet/src/vespa/fnet/frt/supervisor.cpp b/fnet/src/vespa/fnet/frt/supervisor.cpp index 62646350ae9..3a323390ad6 100644 --- a/fnet/src/vespa/fnet/frt/supervisor.cpp +++ b/fnet/src/vespa/fnet/frt/supervisor.cpp @@ -74,8 +74,7 @@ FRT_Supervisor::Get2WayTarget(const char *spec, FNET_Context connContext) FNET_TransportThread *thread = _transport->select_thread(spec, strlen(spec)); return new FRT_Target(thread->GetScheduler(), thread->Connect(spec, &_packetStreamer, - nullptr, FNET_Context(), - this, connContext)); + this, connContext)); } @@ -147,13 +146,6 @@ FRT_Supervisor::InvokeSync(SchedulerPtr scheduler, FNET_Connection *conn, FRT_RP bool -FRT_Supervisor::InitAdminChannel(FNET_Channel *) -{ - return false; -} - - -bool FRT_Supervisor::InitChannel(FNET_Channel *channel, uint32_t pcode) { pcode &= 0xffff; // remove flags; diff --git a/fnet/src/vespa/fnet/frt/supervisor.h b/fnet/src/vespa/fnet/frt/supervisor.h index 0547ba4ae8b..7756c738f09 100644 --- a/fnet/src/vespa/fnet/frt/supervisor.h +++ b/fnet/src/vespa/fnet/frt/supervisor.h @@ -84,7 +84,6 @@ public: // FNET ServerAdapter Interface - bool InitAdminChannel(FNET_Channel *channel) override; bool InitChannel(FNET_Channel *channel, uint32_t pcode) override; // Packet Handling diff --git a/fnet/src/vespa/fnet/iserveradapter.h b/fnet/src/vespa/fnet/iserveradapter.h index cad0625eb80..c58a3e7ebc2 100644 --- a/fnet/src/vespa/fnet/iserveradapter.h +++ b/fnet/src/vespa/fnet/iserveradapter.h @@ -17,31 +17,6 @@ public: virtual ~FNET_IServerAdapter(void) { } /** - * This method is called by the network layer when an incoming - * connection has been accepted. It gives the application a chance - * to define the target packet handler and application context for - * incoming admin packets. All packets received with the reserved - * channel id (FNET_NOID) are considered admin packets. - * - * In order to return true from this method both the handler and - * context must be set for the given channel object. - * - * NOTE: Generally, application code should never close a connection - * by invoking the Close method directly. However, as this method is - * invoked by the transport thread before the connection is added to - * the event-loop framework, the Close method on the incoming - * connection may be invoked by this method. This may be useful for - * limiting the number of allowed concurrent connections. NOTE: if - * the incoming connection is closed, this method MUST NOT return - * true! - * - * @return success(true)/fail(false) - * @param channel the admin channel being initialized. - **/ - virtual bool InitAdminChannel(FNET_Channel *channel) = 0; - - - /** * This method is called by the network layer when opening a new * channel on a connection handled by this server adapter. The * implementation of this method must define the target packet @@ -56,4 +31,3 @@ public: virtual bool InitChannel(FNET_Channel *channel, uint32_t pcode) = 0; }; - diff --git a/fnet/src/vespa/fnet/transport.cpp b/fnet/src/vespa/fnet/transport.cpp index b4e3443b886..7f0061cfdf5 100644 --- a/fnet/src/vespa/fnet/transport.cpp +++ b/fnet/src/vespa/fnet/transport.cpp @@ -188,12 +188,10 @@ FNET_Transport::Listen(const char *spec, FNET_IPacketStreamer *streamer, FNET_Connection * FNET_Transport::Connect(const char *spec, FNET_IPacketStreamer *streamer, - FNET_IPacketHandler *adminHandler, - FNET_Context adminContext, FNET_IServerAdapter *serverAdapter, FNET_Context connContext) { - return select_thread(spec, strlen(spec))->Connect(spec, streamer, adminHandler, adminContext, serverAdapter, connContext); + return select_thread(spec, strlen(spec))->Connect(spec, streamer, serverAdapter, connContext); } uint32_t diff --git a/fnet/src/vespa/fnet/transport.h b/fnet/src/vespa/fnet/transport.h index c3101d37b18..3d21234ac07 100644 --- a/fnet/src/vespa/fnet/transport.h +++ b/fnet/src/vespa/fnet/transport.h @@ -217,25 +217,15 @@ public: * holds a host name (or IP address) and a port number. Example: * connect to www.fast.no on port 80 (using tcp/ip): spec = * 'tcp/www.fast.no:80'. The newly created connection will be - * serviced by this transport layer object. If the adminHandler - * parameter is given, an internal admin channel is created in the - * connection object. The admin channel will be used to deliver - * packets tagged with the reserved channel id (FNET_NOID) to the - * admin handler. + * serviced by this transport layer object. * * @return an object representing the new connection. * @param spec string specifying how and where to connect. * @param streamer custom packet streamer. - * @param adminHandler packet handler for incoming packets on the - * admin channel. - * @param adminContext application context to be used for incoming - * packets on the admin channel. * @param serverAdapter adapter used to support 2way channel creation. * @param connContext application context for the connection. **/ FNET_Connection *Connect(const char *spec, FNET_IPacketStreamer *streamer, - FNET_IPacketHandler *adminHandler = nullptr, - FNET_Context adminContext = FNET_Context(), FNET_IServerAdapter *serverAdapter = nullptr, FNET_Context connContext = FNET_Context()); diff --git a/fnet/src/vespa/fnet/transport_thread.cpp b/fnet/src/vespa/fnet/transport_thread.cpp index 8bb3746c6ad..cbecf417274 100644 --- a/fnet/src/vespa/fnet/transport_thread.cpp +++ b/fnet/src/vespa/fnet/transport_thread.cpp @@ -282,13 +282,11 @@ FNET_TransportThread::Listen(const char *spec, FNET_IPacketStreamer *streamer, FNET_Connection* FNET_TransportThread::Connect(const char *spec, FNET_IPacketStreamer *streamer, - FNET_IPacketHandler *adminHandler, - FNET_Context adminContext, FNET_IServerAdapter *serverAdapter, FNET_Context connContext) { std::unique_ptr<FNET_Connection> conn = std::make_unique<FNET_Connection>(this, streamer, serverAdapter, - adminHandler, adminContext, connContext, spec); + connContext, spec); if (conn->Init()) { return conn.release(); } diff --git a/fnet/src/vespa/fnet/transport_thread.h b/fnet/src/vespa/fnet/transport_thread.h index dfdcf4e1970..4a470fc1e29 100644 --- a/fnet/src/vespa/fnet/transport_thread.h +++ b/fnet/src/vespa/fnet/transport_thread.h @@ -240,25 +240,15 @@ public: * holds a host name (or IP address) and a port number. Example: * connect to www.fast.no on port 80 (using tcp/ip): spec = * 'tcp/www.fast.no:80'. The newly created connection will be - * serviced by this transport layer object. If the adminHandler - * parameter is given, an internal admin channel is created in the - * connection object. The admin channel will be used to deliver - * packets tagged with the reserved channel id (FNET_NOID) to the - * admin handler. + * serviced by this transport layer object. * * @return an object representing the new connection. * @param spec string specifying how and where to connect. * @param streamer custom packet streamer. - * @param adminHandler packet handler for incoming packets on the - * admin channel. - * @param adminContext application context to be used for incoming - * packets on the admin channel. * @param serverAdapter adapter used to support 2way channel creation. * @param connContext application context for the connection. **/ FNET_Connection *Connect(const char *spec, FNET_IPacketStreamer *streamer, - FNET_IPacketHandler *adminHandler = nullptr, - FNET_Context adminContext = FNET_Context(), FNET_IServerAdapter *serverAdapter = nullptr, FNET_Context connContext = FNET_Context()); |