The c-mosquitto package

[ Tags: bsd3, library, program ] [ Propose Tags ]

[Skip to Readme]


Dependencies base (>=4.7 && <5), bytestring, c-mosquitto, containers, inline-c, options, primitive [details]
License BSD3
Copyright 2017(c) Marcin Tolysz
Author Marcin Tolysz
Category Library
Home page
Source repo head: git clone
Uploaded Fri Feb 16 18:22:10 UTC 2018 by tolysz
Distributions NixOS:
Executables c-mosquitto
Downloads 836 total (69 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2018-02-16 [all 3 reports]
Hackage Matrix CI


  • Language
    • C
      • Inline
        • Language.C.Inline.TypeLevel
  • Network
    • Network.Mosquitto
      • Internal
        • Network.Mosquitto.Internal.Inline
        • Network.Mosquitto.Internal.Types


Maintainer's Corner

For package maintainers and hackage trustees

Readme for c-mosquitto-

[back to package description]


Full code

main :: IO ()
main = runCommand $ \MainOptions{..} args -> M.withMosquittoLibrary $ do
  print M.version

  m <- M.newMosquitto True "server" (Just ())
  M.setTls m caCert userCert userKey
  M.setTlsInsecure m True

  -- callbacks
  M.onMessage m print
  M.onLog m $ const putStrLn
  M.onConnect m print
  M.onDisconnect m print
  M.onSubscribe m $ curry print

  M.connect m server port keepAlive

  M.subscribe m 0 "rcv/#"

  forkIO $ forever $ do
    M.publish m False 0 "hello" "bla"
    threadDelay 5000000

  M.loopForever m
  M.destroyMosquitto m
  print "The end"


Documentation for used C library can be found at