New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IMPORTANT) QoS 2 Receive is weired #2625
Comments
Hmm this looks interesting. Can you please clarify which libraries you're using to publish/subscribe? is this still happening? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I'm Mqtt Newbie.
I'm Studing Mqtt with mosquitto. and I'm making Qos 2 chat app.
I get a source and Testing these. Qos 0 / 1 Send and Receive are work normally well.
but Qos 2 is not good.
Here is my problem.
I think, "Publisher" can't receive PUBREC message immediately.
What is the problem?.... I missed something.
Here is my Test Code.
`#include
#include <Windows.h>
#include "mosquitto.h"
#define sleep(x) Sleep((x)*1000)
#define strdup _strdup
#define DEFAULT_MQTT_HOST "127.0.0.1"
#define DEFAULT_MQTT_PORT 1883
#define DEFAULT_MQTT_KEEPALIVE 60
#define DEFAULT_MQTT_TOPIC "EXAMPLE_TOPIC"
#define BUF_LENGTH 65536
using namespace std;
void connect_callback(struct mosquitto* mosq, void* obj, int result) {
printf("connect callback, rc=%d\n", result);
}
void message_callback(struct mosquitto* mosq, void* obj, const struct mosquitto_message* msg) {
printf("message '%.s' for topic '%s'\n", msg->payloadlen, (char)msg->payload, msg->topic);
}
int main(int argc, char** argv)
{
int rc;
char* mqtt_host = strdup(DEFAULT_MQTT_HOST);
char* mqtt_topic = strdup(DEFAULT_MQTT_TOPIC);
int mqtt_port = DEFAULT_MQTT_PORT;
int mqtt_keepalive = DEFAULT_MQTT_KEEPALIVE;
}`
The text was updated successfully, but these errors were encountered: