I have tried in this way, in the "websocket (B4J) class":
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
ws = WebSocket1
ws.Session.MaxInactiveInterval = 10 ' seconds
End Sub
View attachment 43738
So, I expect that the event WebSocket_Disconnected would be triggered after 10 seconds of client inactivity but it wasn't, the connection remains active.
That should be the ideal solution. Otherwise, I thought about using a flag in the "websocket (B4J) class" and test it every X period using a timer, but I have to set this flag for each transaction made by the client and this is a bore (and I might forget to set it).
P.S. and I have to search if many timers (one of each connection) degrade server performance.