public final static int MQTT_CONNECT = 1; //请求连接 public final static int MQTT_CONNACK = 2; //请求应答 public final static int MQTT_PUBLISH = 3; //发布消息 public final static int MQTT_PUBACK = 4; //发布应答 public final static int MQTT_PUBREC = 5; //发布已接收,保证传递1 public final static int MQTT_PUBREL = 6; //发布释放,保证传递2 public final static int MQTT_PUBCOMP = 7; //发布完成,保证传递3 public final static int MQTT_SUBSCRIBE = 8; //订阅请求 public final static int MQTT_SUBACK = 9; //订阅应答 public final static int MQTT_UNSUBSCRIBE = 10; //取消订阅 public final static int MQTT_UNSUBACK = 11; //取消订阅应答 public final static int MQTT_PINGREQ = 12; //ping请求 public final static int MQTT_PINGRESP = 13; //ping响应 public final static int MQTT_DISCONNECT = 14; //断开连接第一次接触这种在socket上的编程.目前想实现一个语音分发的功能, 差不多就是群聊吧.采用的netty, 协议是用的MQTT我目前想法是在服务器这边定义几个handler(非netty中的handler概念), 这个就对应消息类型的几大类, 比如消息handler, 用户handler, 每种handler可以处理几种消息类型. 但是又不知道如何分类比较合适? 请各位帮忙看看. 或者有更好的思路的,请指教.先谢过了.
添加回答
举报
0/150
提交
取消