michalfoksa / rsmb Goto Github PK
View Code? Open in Web Editor NEWMQTT and MQTT-SN broker. Forked from http://git.eclipse.org/c/mosquitto/org.eclipse.mosquitto.rsmb.git
MQTT and MQTT-SN broker. Forked from http://git.eclipse.org/c/mosquitto/org.eclipse.mosquitto.rsmb.git
Hello everyone,
I am using RSMB broker on Ubuntu 14.4 to send UDP packets. I have done bridging in between Mosquitto broker and RSMB broker. When I am sending any UDP packet to RSMB server/broker on specified MQTT-S port, I am facing an error:
20170721 125228.265 CWNAN0075W Socket error 107 (Transport endpoint is not connected) in getpeername for socket 4
20170721 125228.265 CWNAN0021W Badly formed packet on socket 4, peer address unknown; ending connection
If anyone finds a solution to fix this error, please help me to solve this.
I have found a issue with pre-defined topic IDs. The {clientid} was not being replaced with the topic name. It is a very small fix. How can I submit my change? (I'm new to github)
Thanks,
Jeff
If a client on a noisy network misses a SUBACK packet, it will resend the SUBSCRIBE. Since MQTTSProtocol_handleSubscribes
doesn't check if a topic is already registered before registering it, it will send the next SUBACK with a new topic id. But later PUBLISHes on that topic will use the first topic id, which the client doesn't know.
The fix is to use the same check in MQTTProtocol_handleSubscribes
that MQTTProtocol_handleRegisters
uses to see if a topic is already registered.
Here are the changes I had to make to build rsmb on OS X 10.11.5 running version 7.1.3 of the command line tools, for whoever might find them helpful:
In the makefile, change:
CFLAGS=-Wall
to
CFLAGS=-Wall -D_XOPEN_SOURCE
and in Socket.c on the one line where it occurs, change IPV6_ADD_MEMBERSHIP
to IPV6_JOIN_GROUP
Hi Michal,
I am using your fork of this project to do some testing with mqttsn, and I noticed that the broker does not call MQTTProtocol_retries() for the mqtts clients, like it does for the mqtt clients.
Since you seem to care about this code base I thought I would share this with you. I dont know if this patch is even the bast way to implement the fix, but it seems like it should be ok.
Jeffrey
diff --git a/rsmb/src/MQTTSProtocol.c b/rsmb/src/MQTTSProtocol.c
index 049dc68..f88f991 100644
--- a/rsmb/src/MQTTSProtocol.c
+++ b/rsmb/src/MQTTSProtocol.c
@@ -551,7 +551,22 @@ int MQTTSProtocol_handleConnects(void* pack, int sock, char* clientAddr, Clients
}
if (existingClient)
{
ListElement\* outcurrent = NULL;
time_t now = 0;
/\* ensure that inflight messages are retried now by setting the last touched time
\* to very old (0) before calling the retry function
*/
time(&(now));
while (ListNextElement(client->outboundMsgs, &outcurrent))
{
Messages\* m = (Messages*)(outcurrent->content);
m->lastTouch = 0;
}
MQTTProtocol_retries(now, client);
MQTTProtocol_processQueued(client);
}
Log(LOG_INFO, 0, "Client connected to udp port %d from %s (%s)", list->port, client->clientID, clientAddr);
Any subscription to any topic always returns Topic ID: 0x0001.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.