@hackage net-mqtt0.2.1.0
An MQTT Protocol Implementation.
Categories
License
BSD-3-Clause
Maintainer
dustin@spy.net
Links
Versions
Installation
Dependencies (11)
- async >=2.2.1 && <2.3
- attoparsec >=0.13.2 && <0.14
- base >=4.7 && <5
- binary >=0.8.6 && <0.9
- bytestring >=0.10.8 && <0.11
- conduit >=1.3.1 && <1.4 Show all…
Dependents (3)
@hackage/ttn-client, @hackage/net-mqtt-lens, @hackage/net-mqtt-rpc
mqtt
An MQTT protocol implementation for Haskell.
Client Examples
Publish
main :: IO
main = do
mc <- runClient mqttConfig{}
publish mc "tmp/topic" "hello!" False
Subscribe
main :: IO
main = do
mc <- runClient mqttConfig{_msgCB=Just msgReceived}
print =<< subscribe mc [("tmp/topic1", QoS0), ("tmp/topic2", QoS0)]
print =<< waitForClient mc -- wait for the the client to disconnect
where
msgReceived t m = print (t,m)