summaryrefslogtreecommitdiffstats
path: root/fnet
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-05-16 13:51:18 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-05-16 13:51:18 +0000
commit71342aa8139eb5486c11129ead05fefd0aa91c67 (patch)
tree8003f372112cac260a92968084786481793b794e /fnet
parentf973a6caf1020f5ce2914b69852d5ab3cf40c3f8 (diff)
GC unused code.
Diffstat (limited to 'fnet')
-rw-r--r--fnet/src/vespa/fnet/controlpacket.cpp12
-rw-r--r--fnet/src/vespa/fnet/controlpacket.h7
-rw-r--r--fnet/src/vespa/fnet/transport.cpp29
-rw-r--r--fnet/src/vespa/fnet/transport.h5
-rw-r--r--fnet/src/vespa/fnet/transport_thread.cpp48
-rw-r--r--fnet/src/vespa/fnet/transport_thread.h65
6 files changed, 1 insertions, 165 deletions
diff --git a/fnet/src/vespa/fnet/controlpacket.cpp b/fnet/src/vespa/fnet/controlpacket.cpp
index e2ca5fdcf8b..036d80d4541 100644
--- a/fnet/src/vespa/fnet/controlpacket.cpp
+++ b/fnet/src/vespa/fnet/controlpacket.cpp
@@ -80,27 +80,15 @@ FNET_ControlPacket::Print(uint32_t indent)
}
FNET_ControlPacket
-FNET_ControlPacket::NoCommand(FNET_CMD_NOCOMMAND);
-
-FNET_ControlPacket
FNET_ControlPacket::ChannelLost(FNET_CMD_CHANNEL_LOST);
FNET_ControlPacket
FNET_ControlPacket::IOCAdd(FNET_CMD_IOC_ADD);
FNET_ControlPacket
-FNET_ControlPacket::IOCEnableRead(FNET_CMD_IOC_ENABLE_READ);
-
-FNET_ControlPacket
-FNET_ControlPacket::IOCDisableRead(FNET_CMD_IOC_DISABLE_READ);
-
-FNET_ControlPacket
FNET_ControlPacket::IOCEnableWrite(FNET_CMD_IOC_ENABLE_WRITE);
FNET_ControlPacket
-FNET_ControlPacket::IOCDisableWrite(FNET_CMD_IOC_DISABLE_WRITE);
-
-FNET_ControlPacket
FNET_ControlPacket::IOCHandshakeACT(FNET_CMD_IOC_HANDSHAKE_ACT);
FNET_ControlPacket
diff --git a/fnet/src/vespa/fnet/controlpacket.h b/fnet/src/vespa/fnet/controlpacket.h
index c69cb8e086b..59cb3778738 100644
--- a/fnet/src/vespa/fnet/controlpacket.h
+++ b/fnet/src/vespa/fnet/controlpacket.h
@@ -35,10 +35,7 @@ public:
FNET_CMD_NOCOMMAND = 0,
FNET_CMD_CHANNEL_LOST,
FNET_CMD_IOC_ADD,
- FNET_CMD_IOC_ENABLE_READ,
- FNET_CMD_IOC_DISABLE_READ,
FNET_CMD_IOC_ENABLE_WRITE,
- FNET_CMD_IOC_DISABLE_WRITE,
FNET_CMD_IOC_HANDSHAKE_ACT,
FNET_CMD_IOC_CLOSE,
FNET_CMD_EXECUTE,
@@ -48,13 +45,9 @@ public:
FNET_CMD_LASTVALUE = FNET_CMD_BAD_PACKET
};
- static FNET_ControlPacket NoCommand;
static FNET_ControlPacket ChannelLost;
static FNET_ControlPacket IOCAdd;
- static FNET_ControlPacket IOCEnableRead;
- static FNET_ControlPacket IOCDisableRead;
static FNET_ControlPacket IOCEnableWrite;
- static FNET_ControlPacket IOCDisableWrite;
static FNET_ControlPacket IOCHandshakeACT;
static FNET_ControlPacket IOCClose;
static FNET_ControlPacket Execute;
diff --git a/fnet/src/vespa/fnet/transport.cpp b/fnet/src/vespa/fnet/transport.cpp
index d1e26529375..28e645d9e03 100644
--- a/fnet/src/vespa/fnet/transport.cpp
+++ b/fnet/src/vespa/fnet/transport.cpp
@@ -36,9 +36,7 @@ FNET_Transport::FNET_Transport(vespalib::AsyncResolver::SP resolver, vespalib::C
}
}
-FNET_Transport::~FNET_Transport()
-{
-}
+FNET_Transport::~FNET_Transport() = default;
void
FNET_Transport::post_or_perform(vespalib::Executor::Task::UP task)
@@ -186,37 +184,12 @@ FNET_Transport::Add(FNET_IOComponent *comp, bool needRef) {
comp->Owner()->Add(comp, needRef);
}
-void
-FNET_Transport::EnableRead(FNET_IOComponent *comp, bool needRef) {
- comp->Owner()->EnableRead(comp, needRef);
-}
-
-void
-FNET_Transport::DisableRead(FNET_IOComponent *comp, bool needRef) {
- comp->Owner()->DisableRead(comp, needRef);
-}
-
-void
-FNET_Transport::EnableWrite(FNET_IOComponent *comp, bool needRef) {
- comp->Owner()->EnableWrite(comp, needRef);
-}
-
-void
-FNET_Transport::DisableWrite(FNET_IOComponent *comp, bool needRef) {
- comp->Owner()->DisableWrite(comp, needRef);
-}
void
FNET_Transport::Close(FNET_IOComponent *comp, bool needRef) {
comp->Owner()->Close(comp, needRef);
}
-FastOS_TimeInterface *
-FNET_Transport::GetTimeSampler() {
- assert(_threads.size() == 1);
- return _threads[0]->GetTimeSampler();
-}
-
void
FNET_Transport::Main() {
assert(_threads.size() == 1);
diff --git a/fnet/src/vespa/fnet/transport.h b/fnet/src/vespa/fnet/transport.h
index 27264aa1965..6c2aff5ec90 100644
--- a/fnet/src/vespa/fnet/transport.h
+++ b/fnet/src/vespa/fnet/transport.h
@@ -282,10 +282,6 @@ public:
//-------------------------------------------------------------------------
static void Add(FNET_IOComponent *comp, bool needRef = true);
- static void EnableRead(FNET_IOComponent *comp, bool needRef = true);
- static void DisableRead(FNET_IOComponent *comp, bool needRef = true);
- static void EnableWrite(FNET_IOComponent *comp, bool needRef = true);
- static void DisableWrite(FNET_IOComponent *comp, bool needRef = true);
static void Close(FNET_IOComponent *comp, bool needRef = true);
//-------------------------------------------------------------------------
@@ -293,6 +289,5 @@ public:
// only one of: (a) Start, (b) Main
// -------------------------------------------------------------------------
- FastOS_TimeInterface *GetTimeSampler();
void Main();
};
diff --git a/fnet/src/vespa/fnet/transport_thread.cpp b/fnet/src/vespa/fnet/transport_thread.cpp
index a5cf15c3939..f350d7c96b4 100644
--- a/fnet/src/vespa/fnet/transport_thread.cpp
+++ b/fnet/src/vespa/fnet/transport_thread.cpp
@@ -140,10 +140,7 @@ FNET_TransportThread::DiscardEvent(FNET_ControlPacket *cpacket,
context._value.IOC->Close();
context._value.IOC->SubRef();
break;
- case FNET_ControlPacket::FNET_CMD_IOC_ENABLE_READ:
- case FNET_ControlPacket::FNET_CMD_IOC_DISABLE_READ:
case FNET_ControlPacket::FNET_CMD_IOC_ENABLE_WRITE:
- case FNET_ControlPacket::FNET_CMD_IOC_DISABLE_WRITE:
case FNET_ControlPacket::FNET_CMD_IOC_HANDSHAKE_ACT:
case FNET_ControlPacket::FNET_CMD_IOC_CLOSE:
context._value.IOC->SubRef();
@@ -303,28 +300,6 @@ FNET_TransportThread::Add(FNET_IOComponent *comp, bool needRef)
void
-FNET_TransportThread::EnableRead(FNET_IOComponent *comp, bool needRef)
-{
- if (needRef) {
- comp->AddRef();
- }
- PostEvent(&FNET_ControlPacket::IOCEnableRead,
- FNET_Context(comp));
-}
-
-
-void
-FNET_TransportThread::DisableRead(FNET_IOComponent *comp, bool needRef)
-{
- if (needRef) {
- comp->AddRef();
- }
- PostEvent(&FNET_ControlPacket::IOCDisableRead,
- FNET_Context(comp));
-}
-
-
-void
FNET_TransportThread::EnableWrite(FNET_IOComponent *comp, bool needRef)
{
if (needRef) {
@@ -334,17 +309,6 @@ FNET_TransportThread::EnableWrite(FNET_IOComponent *comp, bool needRef)
FNET_Context(comp));
}
-
-void
-FNET_TransportThread::DisableWrite(FNET_IOComponent *comp, bool needRef)
-{
- if (needRef) {
- comp->AddRef();
- }
- PostEvent(&FNET_ControlPacket::IOCDisableWrite,
- FNET_Context(comp));
-}
-
void
FNET_TransportThread::handshake_act(FNET_IOComponent *comp, bool needRef)
{
@@ -471,14 +435,6 @@ FNET_TransportThread::handle_wakeup()
case FNET_ControlPacket::FNET_CMD_IOC_ADD:
handle_add_cmd(context._value.IOC);
break;
- case FNET_ControlPacket::FNET_CMD_IOC_ENABLE_READ:
- context._value.IOC->EnableReadEvent(true);
- context._value.IOC->SubRef();
- break;
- case FNET_ControlPacket::FNET_CMD_IOC_DISABLE_READ:
- context._value.IOC->EnableReadEvent(false);
- context._value.IOC->SubRef();
- break;
case FNET_ControlPacket::FNET_CMD_IOC_ENABLE_WRITE:
context._value.IOC->EnableWriteEvent(true);
if (context._value.IOC->HandleWriteEvent()) {
@@ -487,10 +443,6 @@ FNET_TransportThread::handle_wakeup()
handle_close_cmd(context._value.IOC);
}
break;
- case FNET_ControlPacket::FNET_CMD_IOC_DISABLE_WRITE:
- context._value.IOC->EnableWriteEvent(false);
- context._value.IOC->SubRef();
- break;
case FNET_ControlPacket::FNET_CMD_IOC_HANDSHAKE_ACT:
if (context._value.IOC->handle_handshake_act()) {
context._value.IOC->SubRef();
diff --git a/fnet/src/vespa/fnet/transport_thread.h b/fnet/src/vespa/fnet/transport_thread.h
index dd135502afe..4fc4c58107d 100644
--- a/fnet/src/vespa/fnet/transport_thread.h
+++ b/fnet/src/vespa/fnet/transport_thread.h
@@ -340,43 +340,6 @@ public:
**/
void Add(FNET_IOComponent *comp, bool needRef = true);
-
- /**
- * Calling this method enables read events for the given I/O
- * component. Note that the actual work is performed by the
- * transport thread. This method simply posts an event on the
- * transport thread event queue. NOTE: in order to post async events
- * regarding I/O components, an extra reference to the component
- * needs to be allocated. The needRef flag indicates wether the
- * caller already has done this.
- *
- * @param comp the component that wants read events.
- * @param needRef should be set to false if the caller of this
- * method already has obtained an extra reference to the
- * component. If this flag is true, this method will call the
- * AddRef method on the component.
- **/
- void EnableRead(FNET_IOComponent *comp, bool needRef = true);
-
-
- /**
- * Calling this method disables read events for the given I/O
- * component. Note that the actual work is performed by the
- * transport thread. This method simply posts an event on the
- * transport thread event queue. NOTE: in order to post async events
- * regarding I/O components, an extra reference to the component
- * needs to be allocated. The needRef flag indicates wether the
- * caller already has done this.
- *
- * @param comp the component that no longer wants read events.
- * @param needRef should be set to false if the caller of this
- * method already has obtained an extra reference to the
- * component. If this flag is true, this method will call the
- * AddRef method on the component.
- **/
- void DisableRead(FNET_IOComponent *comp, bool needRef = true);
-
-
/**
* Calling this method enables write events for the given I/O
* component. Note that the actual work is performed by the
@@ -396,24 +359,6 @@ public:
/**
- * Calling this method disables write events for the given I/O
- * component. Note that the actual work is performed by the
- * transport thread. This method simply posts an event on the
- * transport thread event queue. NOTE: in order to post async events
- * regarding I/O components, an extra reference to the component
- * needs to be allocated. The needRef flag indicates wether the
- * caller already has done this.
- *
- * @param comp the component that no longer wants write events.
- * @param needRef should be set to false if the caller of this
- * method already has obtained an extra reference to the
- * component. If this flag is true, this method will call the
- * AddRef method on the component.
- **/
- void DisableWrite(FNET_IOComponent *comp, bool needRef = true);
-
-
- /**
* Signal the completion of an asyncronous handshake operation for
* the given io component. Note that the actual work is performed
* by the transport thread. This method simply posts an event on
@@ -480,16 +425,6 @@ public:
/**
- * Obtain a pointer to the current time sampler. The current time
- * sampler may only be used by the transport thread. Also, it SHOULD
- * be used by ALL methods driven by the transport thread that wants
- * to have an estimate of the current time. This includes the custom
- * application hook, packet delivery callbacks and pingable objects.
- **/
- FastOS_Time *GetTimeSampler() { return &_now; }
-
-
- /**
* Obtain a pointer to the transport thread scheduler. This
* scheduler may be used to schedule tasks to be run by the
* transport thread.