summaryrefslogtreecommitdiff
path: root/src/Network/Tox
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Tox')
-rw-r--r--src/Network/Tox/Avahi.hs13
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
8import Data.Foldable 9import Data.Foldable
9import GHC.Conc.Sync
10import GHC.Word (Word16) 10import GHC.Word (Word16)
11import Network.Address 11import Network.Address
12import Network.Avahi 12import Network.Avahi
13import Network.Avahi
14import Network.Socket 13import Network.Socket
15import Network.Tox.NodeId 14import Network.Tox.NodeId
16import Text.Read 15import Text.Read
@@ -37,12 +36,14 @@ toxService hostname (fromIntegral -> port) (show -> extra) =
37 serviceText = extra 36 serviceText = extra
38 } 37 }
39 38
40announceToxService :: String -> PortNumber -> NodeId -> IO ThreadId 39announceToxServiceWithHostname :: String -> PortNumber -> NodeId -> IO ()
41announceToxService = ((.).(.).(.)) (forkIO . announce) toxService 40announceToxServiceWithHostname = ((.).(.).(.)) announce toxService
41
42announceToxService :: PortNumber -> NodeId -> IO ()
43announceToxService = announceToxServiceWithHostname ""
42 44
43queryToxService :: (NodeInfo -> IO ()) -> IO ThreadId 45queryToxService :: (NodeInfo -> IO ()) -> IO ()
44queryToxService cb = 46queryToxService cb =
45 forkIO $
46 browse $ 47 browse $
47 BrowseQuery 48 BrowseQuery
48 { lookupProtocol = PROTO_UNSPEC 49 { lookupProtocol = PROTO_UNSPEC