56

微信小程序实现WebSocket心跳重连

 5 years ago
source link: https://juejin.im/post/5b5ad3c16fb9a04fab451c9d
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
最近在开发小程序用到了WebSocket,小程序提供了相应的原生API,与H5的API使用方式上有一些区别,所以流行的H5的一些成熟的类库使用起来有些困难,而原生API又存在一些缺陷,所以就自己实现了一套心跳重连机制。 惯例,先简单介绍一下Websocket。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK