angwangiot

Results 4 comments of angwangiot

建议在服务器端的推送上加个功能,服务器端可以主动拒绝客户端的订阅。 比如我这边想用客户端订阅的id来判断是否有权限订阅,如果服务器不能主动拒绝,这样的话不管是谁都可以订阅到了,即使业务逻辑上不去发布这个id的消息,也会在服务器端多占用一个tcp长连接。

可以通过增加溢出标识来处理,具体如下: 1.增加 static uint8_t _timer_overflow_flag = 0; 2.Timer结构体: ``` typedef struct Timer { uint32_t timeout; uint32_t repeat; uint8_t overflow_flag; void (*timeout_cb)(void); struct Timer* next; }Timer; ``` 3. timer_ticks函数改为: ``` void...