Micro letter applet lifecycle webSocket

Test environment: vivo z5 Android9.0 webSocket unrealized groups live

When the applet establish webSocket between the front and rear end, I tested the following four cases.

  1. webSocket established applet page, websocket bright screen with no interaction between the front and back. ------ After 5 minutes, the server websocket active connection is disconnected, the trigger end applet wx.onSocketClose (), is not triggered wx.onSocketError ();
  2. webSocket established applet page, websocket no interaction between the screen and put out front and back. ------ After 5 minutes, the server websocket active connection is disconnected, the trigger end applet wx.onSocketClose (), is not triggered wx.onSocketError ();
  3. webSocket established applet page, the applet cut micro letter backstage. Inner ------ 10s, the active applet disconnected websocket end connected to an end applet triggering wx.onSocketClose (), is not triggered wx.onSocketError ();
  4. webSocket established applet page, micro-channel application cut phone background. Inner ------ 10s, the active applet disconnected websocket end connected to an end applet triggering wx.onSocketClose (), is not triggered wx.onSocketError ();

Added: 1 and 2, referred to 5 minutes, regardless of the session timeout set by the server program Found foregoing.

Guess you like

Origin www.cnblogs.com/wangchengb/p/11334001.html