Created
February 16, 2018 12:24
-
-
Save karlp/a2d50d0bd49313d617c9343b41caad73 to your computer and use it in GitHub Desktop.
mosquitto simple speed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.js" type="text/javascript"></script> | |
<script> | |
client = new Paho.MQTT.Client("somehost", 8083, "clientId"); | |
client.onConnectionLost = onConnectionLost; | |
client.onMessageArrived = onMessageArrived; | |
client.connect({onSuccess:onConnect}); | |
function onConnect() { | |
console.log("onConnect"); | |
client.subscribe("hoho/#"); | |
} | |
function onConnectionLost(responseObject) { | |
if (responseObject.errorCode !== 0) { | |
console.log("onConnectionLost:"+responseObject.errorMessage); | |
} | |
} | |
function onMessageArrived(message) { | |
console.log("onMessageArrived:"+message.payloadString); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do mosquitto_pub -t "hoho/$(date +%s)" -m x; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment