AMX WebSocket Server module bug
tombadger
Posts: 22
When a TCP connection is abruptly severed, module stops to properly track connected clients.
When this happens, module:
- does not generate CLIENT.DISCONNECTED-…. message
- does not respond to ?CLIENTS.CONNECTED command (this generates
WebSocketServer Exception in handleCommandEvent: null
in console) - generates below printstack in console, when a string being sent to the module
EventRouter: user exception in handleDataEvent: org.java_websocket.exceptions.WebsocketNotConnectedException
org.java_websocket.exceptions.WebsocketNotConnectedException
at org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:646)
at org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:622)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.websocket.WebSocketEndpoint.sendToWebSocket(WebSocketEndpoint.java:215)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.websocket.WebSocketEndpoint.lambda$9(WebSocketEndpoint.java:231)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.websocket.WebSocketEndpoint.lambda$8(WebSocketEndpoint.java:231)
at java.util.HashMap.forEach(HashMap.java:1289)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.websocket.WebSocketEndpoint.send(WebSocketEndpoint.java:231)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.websocket.WebSocketEndpointServer.lambda$12(WebSocketEndpointServer.java:383)
at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.websocket.WebSocketEndpointServer.send(WebSocketEndpointServer.java:383)
at com.amx.duet.impl.amx.websocket.server.dr1_0_0.WebSocketServer.handleDataEvent(WebSocketServer.java:606)
at com.amx.duet.devicesdk.base.Module.handleAdvancedEvent(Unknown Source)
at com.amx.duet.routers.snapi.SNAPIRouter.handleAdvancedEvent(SNAPIRouter.java:353)
at com.amx.duet.routers.snapi.SNAPIRouter.handleDataEvent(SNAPIRouter.java:552)
at com.amx.duet.core.master.IcspNetLinxDevice.handleDataEvent(Unknown Source)
at com.amx.duet.core.master.EventRouter.processEvent(Unknown Source)
at com.amx.duet.core.master.EventRouter.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
This issue still occurs even if the same websocket client renew the connection.
It seems that some ghost connection info is being kept by the module.
So far only sending REINIT command or rebooting controller fix the problem till next severed connection event.
0