{"id":19423607,"url":"https://github.com/linfx/mqttfx","last_synced_at":"2025-04-24T16:30:56.473Z","repository":{"id":65369816,"uuid":"41990886","full_name":"linfx/MqttFx","owner":"linfx","description":"MqttFx is a mqtt v3.1.1 client  using DotNetty ","archived":false,"fork":false,"pushed_at":"2022-08-25T00:58:16.000Z","size":498,"stargazers_count":95,"open_issues_count":0,"forks_count":43,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-03T07:22:10.772Z","etag":null,"topics":["dotnetty","mqtt"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-06T06:31:05.000Z","updated_at":"2025-02-26T04:36:30.000Z","dependencies_parsed_at":"2023-01-19T20:40:24.445Z","dependency_job_id":null,"html_url":"https://github.com/linfx/MqttFx","commit_stats":null,"previous_names":["linfx/nmqtt"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linfx%2FMqttFx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linfx%2FMqttFx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linfx%2FMqttFx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linfx%2FMqttFx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linfx","download_url":"https://codeload.github.com/linfx/MqttFx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250663544,"owners_count":21467366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnetty","mqtt"],"created_at":"2024-11-10T13:40:03.016Z","updated_at":"2025-04-24T16:30:56.080Z","avatar_url":"https://github.com/linfx.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MqttFx\n\nc# mqtt 3.1.1 client\n\n***\n\n## Install\n\n`PM\u003e Install-Package MqttFx`\n\n\n## Samples\n```c#\n\n    class Program\n    {\n        static async Task Main(string[] args)\n        {\n            var services = new ServiceCollection();\n            services.AddMqttFxClient(options =\u003e\n            {\n                options.Host = \"broker.emqx.io\";\n                options.Port = 1883;\n            });\n            var container = services.BuildServiceProvider();\n\n            var client = container.GetService\u003cMqttClient\u003e();\n\n            client.ConnectedAsync += async e =\u003e\n            {\n                Console.WriteLine(\"### CONNECTED WITH SERVER ###\");\n\n                Console.WriteLine(\"### SUBSCRIBED ###\");\n\n                var subscriptionRequests = new SubscriptionRequestsBuilder()\n                    .WithTopicFilter(f =\u003e f.WithTopic(\"testtopic/a\"))\n                    .WithTopicFilter(f =\u003e f.WithTopic(\"testtopic/b\").WithAtLeastOnceQoS())\n                    .Build();\n\n                var subscribeResult = await client.SubscribeAsync(subscriptionRequests);\n\n                foreach (var item in subscribeResult.Items)\n                {\n                    Console.WriteLine($\"+ ResultCode = {item.ResultCode}\");\n                }\n            };\n\n            client.ApplicationMessageReceivedAsync += async message =\u003e\n            {\n                Console.WriteLine(\"### RECEIVED APPLICATION MESSAGE ###\");\n                Console.WriteLine($\"+ Topic = {message.Topic}\");\n                Console.WriteLine($\"+ Payload = {Encoding.UTF8.GetString(message.Payload)}\");\n                Console.WriteLine($\"+ QoS = {message.Qos}\");\n                Console.WriteLine($\"+ Retain = {message.Retain}\");\n                Console.WriteLine();\n\n                await Task.CompletedTask;\n            };\n\n            var connectResult = await client.ConnectAsync();\n            if (connectResult.Succeeded)\n            {\n                for (int i = 1; i \u003c= 3; i++)\n                {\n                    await Task.Delay(500);\n                    Console.WriteLine(\"### Publish Message ###\");\n\n                    var mesage = new ApplicationMessageBuilder()\n                        .WithTopic(\"testtopic/ab\")\n                        .WithPayload($\"HelloWorld: {i}\")\n                        .WithQos(MqttQos.AtLeastOnce)\n                        .Build();\n\n                    await client.PublishAsync(mesage);\n                }\n            }\n            else\n                Console.WriteLine(\"Connect Fail!\");\n\n            Console.ReadKey();\n        }\n    }\n\n```\n\n## MQTT 规范\n\n你可以通过以下链接了解与查阅 MQTT 协议:\n\n[MQTT 协议中文版](https://mcxiaoke.gitbooks.io/mqtt-cn/content/)\n\n[MQTT Version 3.1.1](https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html)\n\n[MQTT Version 5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/cs02/mqtt-v5.0-cs02.html)\n\n[MQTT SN](https://www.oasis-open.org/committees/download.php/66091/MQTT-SN_spec_v1.2.pdf)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinfx%2Fmqttfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinfx%2Fmqttfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinfx%2Fmqttfx/lists"}