summaryrefslogtreecommitdiff
path: root/Assistant/Pairing
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-09 16:24:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-09 16:24:34 -0400
commit16cefae7f276e12c20e203729aad23cfd90f0ec3 (patch)
tree24291391d3a9affc1f987f7b200c3c8fb0a49961 /Assistant/Pairing
parentded85175455bf355753ea26263898487c2162ab5 (diff)
add an alert while a locally initiated pairing request is in progress
Has a button to cancel the request.
Diffstat (limited to 'Assistant/Pairing')
-rw-r--r--Assistant/Pairing/Network.hs9
1 files changed, 4 insertions, 5 deletions
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