Remove dead code

aliveNotification() and unresponsiveTransport() never called.
Remove these, and code only referenced through these methods.
This commit is contained in:
Michael Davidsaver
2019-05-20 22:29:01 -07:00
parent c9bd214f7c
commit a6e7d7f5fc
8 changed files with 0 additions and 123 deletions

1
TODO
View File

@ -6,6 +6,5 @@
- improve searching of channel with server address specified
- void transportUnresponsive() is not implemented (also in Java)
- complete authNZ (callback on right change)
- request event on disconnect/destroy, etc.?

View File

@ -1697,7 +1697,6 @@ BlockingClientTCPTransportCodec::BlockingClientTCPTransportCodec(
BlockingTCPTransportCodec(false, context, channel, responseHandler,
sendBufferSize, receiveBufferSize, priority),
_connectionTimeout(heartbeatInterval),
_unresponsiveTransport(false),
_verifyOrEcho(true),
sendQueued(true) // don't start sending echo until after auth complete
{
@ -1746,22 +1745,6 @@ void BlockingClientTCPTransportCodec::callback()
catch (std::exception &e) { LOG(logLevelError, "Unhandled exception caught from code at %s:%d: %s", __FILE__, __LINE__, e.what()); } \
catch (...) { LOG(logLevelError, "Unhandled exception caught from code at %s:%d.", __FILE__, __LINE__); }
void BlockingClientTCPTransportCodec::unresponsiveTransport() {
Lock lock(_mutex);
if(!_unresponsiveTransport) {
_unresponsiveTransport = true;
TransportClientMap_t::iterator it = _owners.begin();
for(; it!=_owners.end(); it++) {
ClientChannelImpl::shared_pointer client = it->second.lock();
if (client)
{
EXCEPTION_GUARD(client->transportUnresponsive());
}
}
}
}
bool BlockingClientTCPTransportCodec::acquire(ClientChannelImpl::shared_pointer const & client) {
Lock lock(_mutex);
if(isClosed()) return false;
@ -1835,42 +1818,8 @@ void BlockingClientTCPTransportCodec::release(pvAccessID clientID) {
}
}
void BlockingClientTCPTransportCodec::aliveNotification() {
// TODO: dead code
Lock guard(_mutex);
//epicsTimeGetCurrent(&_aliveTimestamp);
if(_unresponsiveTransport) responsiveTransport();
}
void BlockingClientTCPTransportCodec::responsiveTransport() {
Lock lock(_mutex);
if(_unresponsiveTransport) {
_unresponsiveTransport = false;
Transport::shared_pointer thisSharedPtr = shared_from_this();
TransportClientMap_t::iterator it = _owners.begin();
for(; it!=_owners.end(); it++) {
ClientChannelImpl::shared_pointer client = it->second.lock();
if (client)
{
EXCEPTION_GUARD(client->transportResponsive(thisSharedPtr));
}
}
}
}
void BlockingClientTCPTransportCodec::changedTransport() {
_outgoingIR.reset();
Lock lock(_mutex);
TransportClientMap_t::iterator it = _owners.begin();
for(; it!=_owners.end(); it++) {
ClientChannelImpl::shared_pointer client = it->second.lock();
if (client)
{
EXCEPTION_GUARD(client->transportChanged());
}
}
}
void BlockingClientTCPTransportCodec::send(ByteBuffer* buffer,

View File

@ -97,10 +97,6 @@ public:
// noop for UDP (limited by 64k; MAX_UDP_SEND for PVA)
}
virtual void aliveNotification() OVERRIDE FINAL {
// noop
}
virtual void changedTransport() OVERRIDE FINAL {
// noop
}

View File

@ -558,10 +558,6 @@ public:
BlockingTCPTransportCodec::verified(status);
}
virtual void aliveNotification() OVERRIDE FINAL {
// noop on server-side
}
void authNZInitialize(const std::string& securityPluginName,
const epics::pvData::PVStructure::shared_pointer& data);
@ -662,8 +658,6 @@ public:
virtual void changedTransport() OVERRIDE FINAL;
virtual void aliveNotification() OVERRIDE FINAL;
virtual void send(epics::pvData::ByteBuffer* buffer,
TransportSendControl* control) OVERRIDE FINAL;
@ -691,30 +685,15 @@ private:
*/
const double _connectionTimeout;
/**
* Unresponsive transport flag.
*/
bool _unresponsiveTransport;
bool _verifyOrEcho;
// are we queued to send verify or echo?
bool sendQueued;
/**
* Unresponsive transport notify.
*/
void unresponsiveTransport();
/**
* Notifies clients about disconnect.
*/
void closedNotifyClients();
/**
* Responsive transport notify.
*/
void responsiveTransport();
};
}

View File

@ -250,11 +250,6 @@ public:
*/
virtual bool verify(epics::pvData::int32 timeoutMs) = 0;
/**
* Notification transport that is still alive.
*/
virtual void aliveNotification() = 0;
/**
* Close transport.
*/

View File

@ -3675,13 +3675,6 @@ public:
reportChannelStateChange();
}
virtual void transportChanged() OVERRIDE FINAL {
// initiateSearch();
// TODO
// this will be called immediately after reconnect... bad...
}
virtual Transport::shared_pointer checkAndGetTransport() OVERRIDE FINAL
{
Lock guard(m_channelMutex);
@ -3711,35 +3704,6 @@ public:
return m_transport;
}
virtual void transportResponsive(Transport::shared_pointer const & /*transport*/) OVERRIDE FINAL {
Lock guard(m_channelMutex);
if (m_connectionState == DISCONNECTED)
{
updateSubscriptions();
// reconnect using existing IDs, data
connectionCompleted(m_serverChannelID/*, accessRights*/);
}
}
virtual void transportUnresponsive() OVERRIDE FINAL {
/*
{
Lock guard(m_channelMutex);
if (m_connectionState == CONNECTED)
{
// TODO 2 types of disconnected state - distinguish them otherwise disconnect will handle connection loss right
setConnectionState(DISCONNECTED);
// ... PVA notifies also w/ no access rights callback, although access right are not changed
}
}
// should be called without any lock hold
reportChannelStateChange();
*/
}
/**
* Set connection state and if changed, notifies listeners.
* @param newState state to set.

View File

@ -53,10 +53,7 @@ public:
virtual Transport::shared_pointer checkAndGetTransport() = 0;
virtual Transport::shared_pointer checkDestroyedAndGetTransport() = 0;
virtual Transport::shared_pointer getTransport() = 0;
virtual void transportUnresponsive() =0;
virtual void transportChanged() =0;
virtual void transportClosed() =0;
virtual void transportResponsive(Transport::shared_pointer const & /*transport*/) =0;
static epics::pvData::Status channelDestroyed;
static epics::pvData::Status channelDisconnected;

View File

@ -382,8 +382,6 @@ public:
void verified(epics::pvData::Status const &) {}
void aliveNotification() {}
void authNZMessage(epics::pvData::PVStructure::shared_pointer const & data) {}