summaryrefslogtreecommitdiff
path: root/avahi.hs
blob: 2db3be71880dd5cd9af4b6080688acf366c23cfd (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 $ announceToxService hostname (fromMaybe 54321 $ readMaybe port) (fromMaybe exampleNodeId $ readMaybe nodeId)
  void $ queryToxService print
  void $ getLine