From 16cefae7f276e12c20e203729aad23cfd90f0ec3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Sep 2012 16:24:34 -0400 Subject: add an alert while a locally initiated pairing request is in progress Has a button to cancel the request. --- Assistant/Pairing/Network.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Assistant/Pairing/Network.hs') diff --git a/Assistant/Pairing/Network.hs b/Assistant/Pairing/Network.hs index ec7054f9e..2b645a9d9 100644 --- a/Assistant/Pairing/Network.hs +++ b/Assistant/Pairing/Network.hs @@ -14,7 +14,6 @@ import Utility.ThreadScheduler import Network.Multicast import Network.Info import Network.Socket -import Control.Concurrent import Control.Exception (bracket) import qualified Data.Map as M @@ -31,8 +30,8 @@ multicastAddress :: SomeAddr -> HostName multicastAddress (IPv4Addr _) = "224.0.0.1" multicastAddress (IPv6Addr _) = "ff02::1" -{- Multicasts a message repeatedly on all interfaces until its thread - - is killed, with a 2 second delay between each transmission. +{- Multicasts a message repeatedly on all interfaces forever, + - with a 2 second delay between each transmission. - - The remoteHostAddress is set to the interface's IP address. - @@ -40,8 +39,8 @@ multicastAddress (IPv6Addr _) = "ff02::1" - but it allows new network interfaces to be used as they come up. - On the other hand, the expensive DNS lookups are cached. -} -multicastPairMsg :: (SomeAddr -> PairMsg) -> IO ThreadId -multicastPairMsg mkmsg = forkIO $ go M.empty +multicastPairMsg :: (SomeAddr -> PairMsg) -> IO () +multicastPairMsg mkmsg = go M.empty where go cache = do addrs <- activeNetworkAddresses -- cgit v1.2.3