Comments (3)
I'm getting a bad access error in Xcode debugger when attempting to publish for the first time at the if statement referencing curr->packet_id
from __mqtt_next_pid
called from mqtt_publish
/* check that the PID is unique */
pid_exists = 0;
for(curr = mqtt_mq_get(&(client->mq), 0); curr >= client->mq.queue_tail; --curr) {
if (curr->packet_id == client->pid_lfsr) {
pid_exists = 1;
break;
}
}
from mqtt-c.
@leisurehound Thanks for writing.
Is combining the aspects of reconnect_subscriber.c and simple_publisher.c viable?
Absolutely. The examples are meant to be standalone demos of a certain feature/ability. The reconnect_subscriber demonstrates how the "reconnect" functionality is used (compare with simple_subscriber). For a real application you should implement your own handling and make use of the features you need (including potentially implementing your own PAL).
Also, can two sockets/struct clients be created to the same broker to publish multiple topics (at different update rates, effectively)?
Having mutliple mqtt_client
is fine, and it's fine to connect them to the same broker. Note that you don't need multiple clients to publish at different rates. Doing mqtt_publish(...)
stages the message for sending and it will be sent the next time mqtt_sync(...)
is called. Assuming you're using a fixed sync rate (e.g., 500 ms) the rate of publishing is simply how often you do mqtt_publish()
.
BTW, I'm wrapping MQTT-C into a Swift wrapper so I can work in swift for the data logic bits.
Cool! Share the link when you're done, I'd be interested in checking it out.
I'm getting a bad access error in Xcode debugger when attempting to publish for the first time at the if statement referencing curr->packet_id from __mqtt_next_pid called from mqtt_publish
Sorry, I'm not familiar with the Xcode debugger. I'm afraid I don't have any insight.
from mqtt-c.
I'm getting a bad access error in Xcode debugger when attempting to publish for the first time at the if statement referencing curr->packet_id from __mqtt_next_pid called from mqtt_publish
Sorry, I'm not familiar with the Xcode debugger. I'm afraid I don't have any insight.
ok, seems LLVM is not liking the mutex being set before the call __mqtt_next_pid
where it references curr->packet_id
from mqtt-c.
Related Issues (20)
- Adding contex to callbacks HOT 1
- Insufficient validation of PUBLISH message HOT 2
- Possible undefined behaviour/bad memory access after reconnect HOT 2
- MQTT_ERROR_SEND_BUFFER_IS_FULL due to transient MQTT_ERROR_SOCKET_ERROR
- FPU-Trap when calculating client->typical_response_time
- mqtt_publish return value causes mqtt_error_str when not connected
- mqtt_publish seems to only send QoS 0 HOT 1
- Possible bug in MQTT_CLIENT_TRY_PACK macro
- MQTT-C Security Issue Report (mqtt_unpack_publish_response) HOT 2
- swap use of double variables to float HOT 1
- How to check the client has received a Connack from the Broker after connect() HOT 7
- how to check network connection state in inspector callback
- Signed integer overflow in `mqtt_error_str()` HOT 2
- We cannot pass the context of the program to mqtt publish_callback HOT 2
- Mingw compile error
- Memory alignment in Keil ARM Compiler (thumb instruction set)
- mqtt_connect does not generate a client.error if wrong username and/or password is provided HOT 2
- Unable to connect openssl_publisher example to HiveMQ HOT 4
- Windows MSYS2 MINGW64: Examples fail with "MQTT_ERROR_SOCKET_ERROR" or "Failed to open socket: : No error"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt-c.