diff options
Diffstat (limited to 'src/Network/Tox')
-rw-r--r-- | src/Network/Tox/Avahi.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Network/Tox/Avahi.hs b/src/Network/Tox/Avahi.hs index ba5138bc..ed52de74 100644 --- a/src/Network/Tox/Avahi.hs +++ b/src/Network/Tox/Avahi.hs | |||
@@ -5,12 +5,11 @@ module Network.Tox.Avahi | |||
5 | , NodeInfo(..) | 5 | , NodeInfo(..) |
6 | , NodeId(..) | 6 | , NodeId(..) |
7 | ) where | 7 | ) where |
8 | |||
8 | import Data.Foldable | 9 | import Data.Foldable |
9 | import GHC.Conc.Sync | ||
10 | import GHC.Word (Word16) | 10 | import GHC.Word (Word16) |
11 | import Network.Address | 11 | import Network.Address |
12 | import Network.Avahi | 12 | import Network.Avahi |
13 | import Network.Avahi | ||
14 | import Network.Socket | 13 | import Network.Socket |
15 | import Network.Tox.NodeId | 14 | import Network.Tox.NodeId |
16 | import Text.Read | 15 | import Text.Read |
@@ -37,12 +36,14 @@ toxService hostname (fromIntegral -> port) (show -> extra) = | |||
37 | serviceText = extra | 36 | serviceText = extra |
38 | } | 37 | } |
39 | 38 | ||
40 | announceToxService :: String -> PortNumber -> NodeId -> IO ThreadId | 39 | announceToxServiceWithHostname :: String -> PortNumber -> NodeId -> IO () |
41 | announceToxService = ((.).(.).(.)) (forkIO . announce) toxService | 40 | announceToxServiceWithHostname = ((.).(.).(.)) announce toxService |
41 | |||
42 | announceToxService :: PortNumber -> NodeId -> IO () | ||
43 | announceToxService = announceToxServiceWithHostname "" | ||
42 | 44 | ||
43 | queryToxService :: (NodeInfo -> IO ()) -> IO ThreadId | 45 | queryToxService :: (NodeInfo -> IO ()) -> IO () |
44 | queryToxService cb = | 46 | queryToxService cb = |
45 | forkIO $ | ||
46 | browse $ | 47 | browse $ |
47 | BrowseQuery | 48 | BrowseQuery |
48 | { lookupProtocol = PROTO_UNSPEC | 49 | { lookupProtocol = PROTO_UNSPEC |