Skip to content

Commit

Permalink
Restore socket retry functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed Nov 18, 2024
1 parent 3aa883c commit 4fb758e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/cpp/filewatchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ struct FileWatchdog::FileWatchdogPrivate{
#if LOG4CXX_EVENTS_AT_EXIT
, atExitRegistryRaii([this]{stopWatcher();})
#endif
{ }

~FileWatchdogPrivate()
{ stopWatcher(); }

/**
The name of the file to observe for changes.
*/
Expand Down
5 changes: 4 additions & 1 deletion src/main/cpp/telnetappender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ struct TelnetAppender::TelnetAppenderPriv : public AppenderSkeletonPrivate
#if LOG4CXX_EVENTS_AT_EXIT
, atExitRegistryRaii([this]{stopAcceptingConnections();})
#endif
{ stopAcceptingConnections(); }
{ }

~TelnetAppenderPriv()
{ stopAcceptingConnections(); }

int port;
ConnectionList connections;
Expand Down
1 change: 1 addition & 0 deletions src/main/cpp/xmlsocketappender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void XMLSocketAppender::append(const spi::LoggingEventPtr& event, LOG4CXX_NS::he
}
catch (std::exception& e)
{
_priv->writer->close(p);
_priv->writer = nullptr;
LogLog::warn(LOG4CXX_STR("Detected problem with connection: "), e);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : public AppenderSkele
#if LOG4CXX_EVENTS_AT_EXIT
, atExitRegistryRaii([this]{stopMonitor();})
#endif
{ stopMonitor(); }
{ }

SocketAppenderSkeletonPriv(helpers::InetAddressPtr address, int defaultPort, int reconnectionDelay) :
AppenderSkeletonPrivate(),
Expand All @@ -54,7 +54,7 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : public AppenderSkele
#if LOG4CXX_EVENTS_AT_EXIT
, atExitRegistryRaii([this]{stopMonitor();})
#endif
{ stopMonitor(); }
{ }

SocketAppenderSkeletonPriv(const LogString& host, int port, int delay) :
AppenderSkeletonPrivate(),
Expand All @@ -66,6 +66,9 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : public AppenderSkele
#if LOG4CXX_EVENTS_AT_EXIT
, atExitRegistryRaii([this]{stopMonitor();})
#endif
{ }

~SocketAppenderSkeletonPriv()
{ stopMonitor(); }

/**
Expand Down

0 comments on commit 4fb758e

Please sign in to comment.