Code Monkey home page Code Monkey logo

nmqtt's People

Contributors

ljungloef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmqtt's Issues

Can't build in Xamarin

I admit that i'm quite new to Xamarin and developing in C# in general. But it seems like impossible for me to build this library. I've had my teacher look at it as well, and we couldn't figure it out. Maybe there's a known issue? :)

This is the error I get:
/Users/path/nmqtt/.nuget/nuget.targets: Error: Command 'mono --runtime=v4.0.30319 /Users/path/nmqtt/.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/Users/path/nmqtt/"' exited with code: 2. (nMQTT)

(replaced original path with path for overview purpose)

Thanks in advance, bobby

Update to correct handling of strings as UTF8

Currently we handle strings as ASCII only, which works most of the time, but won't work if anyone ever uses utf8 in a message, topic or any other string field, all of which are supposed to support utf8

used by webapi

1.in MessageLogger.cs:
it's better to use a Property or Parameter to replace Settings.Default.EnableMessageLogging, otherwise it cann't be used in webapi

2.when dispose the client after PublishMessage immediately, it will throw an exception that nullobject reference, maybe need a strategy wait for the ReadHeaderComple complete.

switch from using callbacks to events for message notification

The current implementation uses callbacks to notify a consumer when a message that matches what they asked for is available. This doesn't play nicely with QOS level 1 and 2 subscriptions, or when the connect-clean flag is not set upon connection (ie persisted subscriptions) because the client would have to somehow re-hook the callbacks when re-establishing the connections.

Switching to using events would cause a level of indirection on client consumers with the benefit of a simpler, more understandable API.

MqttClient.cs can't handle large messages

Messages are read from a socket synchronously in a single read. When the expected message size is large, Read will return less bytes than requested.
The incomplete message is then parsed and the client crashes.
Repeat reads from the socket until the complete message has been received.

PublishingManager

Hi, I'm using QOS ExactlyOnce. Is this supported as I notice you have an issue below. Basically when I use this the code below throws an error. It is because the GetNextMessageIdentifier returns a count only unique per topic. The id is then added to publishedMessages dictionary which contains all sent messages. Therefore I send a message to topic A and then to topic B, both will be given ID 1 and the dictionary add fails as the key already exists. Am I doing something wrong?

public short Publish(string topic, MqttQos qualityOfService, object data)
where TDataConverter : IPublishDataConverter
{
short msgID = MessageIdentifierDispenser.GetNextMessageIdentifier(String.Format("Topic:{0}", topic));

        IPublishDataConverter converter = GetPublishDataConverter<TDataConverter>();

        MqttPublishMessage msg = new MqttPublishMessage()
            .ToTopic(topic)
            .WithMessageIdentifier(msgID)
            .WithQos(qualityOfService)
            .PublishData(converter.ConvertToBytes(data));

        // QOS level 1 or 2 messages need to be saved so we can do the ack processes
        if (qualityOfService == MqttQos.AtLeastOnce || qualityOfService == MqttQos.ExactlyOnce)
        {
            Console.WriteLine("{0}",System.Threading.Thread.CurrentThread.ManagedThreadId);
            publishedMessages.Add(msgID, msg);
        }

        connectionHandler.SendMessage(msg);

        return msgID;
    }

I fixed this by adding the following unpleasant hack at the start of function MessageIdentifierDispenser.GetNextMessageIdentifier:

key = "All";

Thereby ensuring that all messages are counted consecutively regardless of topic

Implement topic wildcard support

Topic subscriptions have semantics which can contain wildcards, such as:

finance/stocks/ibm/# 

which would allow matching of topics such as:

finance/stocks/ibm/live
finance/stocks/ibm/eod

We need to support subscriptions of this nature along with the other cases that are mentioned in Appendix A of the MQTT spec.

How to auto reconnect

  1. My Nmqtt application does not work(reconnection), when mosquitto restart.
  2. After manual reconnection NMQTT, my subscription need to reSubscribe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.