Giter Site home page Giter Site logo

mqttservice's Introduction

MQTTService

模仿Mosquitto实现一个iOS客户端的MQTT网络库

这里是MQTT协议中文文档。根据文档第三章的内容,逐步实现MQTT协议各种控制报文。但根据简易程度的不同调整了实现的小节顺序

参照Commit,实现顺序依次为:

1.socket通讯的建立

2.Connect Command的发送

3.解析接收的消息,依据首字节高四位命令区分消息类型。

4.PINGREQ/PINGRESP的处理(连接的keep alive)

5.SUBSCRIBE/UNSUBSCRIBE的处理 (消息的订阅与取消订阅

6.PUBLISH的实现

PUBLISH涉及不同Qos的处理。而且与上面的消息类型有所不同的是,PUBLISH是Broker和Client互推,需要针对每一种send以及ack都做出对应的处理。这一部分细分为以下几块

  • 不同Qos的PUBLISH的发送
  • Qos = 0:发送成功即可
  • Qos = 1:需要接收到PUBACK
  • Qos = 2:需要处理PUBREC/PUBREL/PUBCOMP三种情况

尚未完成,更新中...

mqttservice's People

Contributors

noskthing avatar

Watchers

 avatar  avatar  avatar

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.