Skip to content

基于CocosCreator 并使用 typeScript 实现的mqant客户端库

Notifications You must be signed in to change notification settings

firzen51/CocosCreator_mqantClient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CocosCreator mqant client 简单使用说明

导入项目后,paho-mqtt 设置为插件 初始化连接后

    mqant = new mqant()
    this.mqant.init({
        host: host,
        port: port,
        client_id: "111",
        useSSL: false,
        connect: function () {
            console.log("onConnected");
        },
        onConnectionLost: function (reason) {
            console.log(reason)
        }
    });

添加持久监听模式.使用onProxy统一注册协议

由于golang json库 针对[]byte二次序列化会base64编码. 添加一个base64库.

然后就可以愉快使用了

已在小游戏环境和模拟器环境测试通过!!!!

按道理也可用于Egert 和 Laya 项目,并未测试

About

基于CocosCreator 并使用 typeScript 实现的mqant客户端库

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.5%
  • TypeScript 13.5%