From 29829cfd42bc3b15dfde49feeac82bcc4262096f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Aug 2013 13:49:04 -0400 Subject: clarify notifyNetMessagerRestart --- Assistant/NetMessager.hs | 4 ++++ Assistant/Threads/NetWatcher.hs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Assistant') diff --git a/Assistant/NetMessager.hs b/Assistant/NetMessager.hs index 329d808fc..acb18b648 100644 --- a/Assistant/NetMessager.hs +++ b/Assistant/NetMessager.hs @@ -29,6 +29,10 @@ notifyNetMessagerRestart :: Assistant () notifyNetMessagerRestart = flip writeSV () <<~ (netMessagerRestart . netMessager) +{- This can be used to get an early indication if the network has + - changed, to immediately restart a connection. However, that is not + - available on all systems, so clients also need to deal with + - restarting dropped connections in the usual way. -} waitNetMessagerRestart :: Assistant () waitNetMessagerRestart = readSV <<~ (netMessagerRestart . netMessager) diff --git a/Assistant/Threads/NetWatcher.hs b/Assistant/Threads/NetWatcher.hs index 5974de11d..0d8442c69 100644 --- a/Assistant/Threads/NetWatcher.hs +++ b/Assistant/Threads/NetWatcher.hs @@ -39,7 +39,11 @@ netWatcherThread = thread noop - network connection changes, but it also ensures that - any networked remotes that may have not been routable for a - while (despite the local network staying up), are synced with - - periodically. -} + - periodically. + - + - Note that it does not call notifyNetMessagerRestart, because + - it doesn't know that the network has changed. + -} netWatcherFallbackThread :: NamedThread netWatcherFallbackThread = namedThread "NetWatcherFallback" $ runEvery (Seconds 3600) <~> handleConnection -- cgit v1.2.3