Created
April 15, 2014 16:37
-
-
Save njh/10746150 to your computer and use it in GitHub Desktop.
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
// Create a new server | |
mosq = mosquitto_server_new(); | |
// Configure more stuff | |
mosquitto_server_set_opt(MOSQUITTO_SERVER_TLS, FALSE); | |
// Bind server to a socket | |
mosquitto_server_bind(mosq, 1883); | |
while (!mosquitto_server_loop(mosq)) { | |
// Send message to all subscribers | |
char msg* = "My message"; | |
mosquitto_server_publish_str(mosq, "test/foo", msg); | |
} | |
mosquitto_server_destroy(mosq); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment