summaryrefslogtreecommitdiff
path: root/avahi.hs
blob: aeb8138f4ed8a2217f6a50e771caa3bc191d7430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE NoImplicitPrelude #-}

import           BasePrelude
import           Network.Tox.Avahi

exampleNodeId :: NodeId
exampleNodeId = read $ replicate 43 'a'

main :: IO ()
main = do
  [hostname, port, nodeId] <- getArgs
  void $ forkIO $ announceToxServiceWithHostname hostname (fromMaybe 54321 $ readMaybe port) (fromMaybe exampleNodeId $ readMaybe nodeId)
  void $ forkIO $ queryToxService print
  void $ getLine