when i use MyScriptJS on wechat mini program, websocket can connect but disconnected after a while, it report error [code : 1006 reason : "abnormal closure"]
onClose:2493
LoggerConfig.js:16 close websocket callback:{"code":1006,"reason":"abnormal closure","type":"close"}
Best Answer
O
Olivier @MyScript
said
over 1 year ago
Dear Ling Long,
thank you for contacting us.
The reason of this error is likely because the webSocket has been closed. Indeed, after 3 minutes without exchanges, the channel is closed (see the "What counts as a request?" part of the pricing documentation: https://developer.myscript.com/pricing).
what does [code : 1006 reason : "abnormal closure"] mean, what can do to fix it.
O
Olivier @MyScript
said
over 1 year ago
Answer
Dear Ling Long,
thank you for contacting us.
The reason of this error is likely because the webSocket has been closed. Indeed, after 3 minutes without exchanges, the channel is closed (see the "What counts as a request?" part of the pricing documentation: https://developer.myscript.com/pricing).
ling long
Hi,
when i use MyScriptJS on wechat mini program, websocket can connect but disconnected after a while, it report error [code : 1006 reason : "abnormal closure"]
onClose:2493
LoggerConfig.js:16 close websocket callback:{"code":1006,"reason":"abnormal closure","type":"close"}
Dear Ling Long,
thank you for contacting us.
The reason of this error is likely because the webSocket has been closed. Indeed, after 3 minutes without exchanges, the channel is closed (see the "What counts as a request?" part of the pricing documentation: https://developer.myscript.com/pricing).
In order to prevent the closing, you can use a ping-pong mechanism: the https://developer.myscript.com/docs/interactive-ink/1.3/web/websockets/messages/#ping-pong
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by Oldest Firstling long
what does [code : 1006 reason : "abnormal closure"] mean, what can do to fix it.
Olivier @MyScript
Dear Ling Long,
thank you for contacting us.
The reason of this error is likely because the webSocket has been closed. Indeed, after 3 minutes without exchanges, the channel is closed (see the "What counts as a request?" part of the pricing documentation: https://developer.myscript.com/pricing).
In order to prevent the closing, you can use a ping-pong mechanism: the https://developer.myscript.com/docs/interactive-ink/1.3/web/websockets/messages/#ping-pong
Best regards,
Olivier