Strange behaviour when closing a resource server side.
When you close a resource server side, and the client reconnects, broadcaster atmosphere resources are empty.
resource.getResponse().close(); resource.getRequest().destroy(true); broadcaster.removeAtmosphereResource(resource);
client reconnects but: broadcaster.getAtmosphereResources().size() == 0
client log:
Invoking executeWebSocket, using URL: ws://localhost:8080/websocket?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.3.1-javascript&X-Atmosphere-Transport=websocket&Content-Type=application/json&X-atmo-protocol=true atmosph...${build (line 3258) Tue Feb 09 2016 13:12:44 GMT+0100 (CET) Atmosphere: websocket.onopen atmosph...${build (line 3258) Websocket successfully opened atmosph...${build (line 3258) Tue Feb 09 2016 13:12:44 GMT+0100 (CET) Atmosphere: websocket.onmessage atmosph...${build (line 3258) Tue Feb 09 2016 13:12:44 GMT+0100 (CET) Atmosphere: Firing onOpen atmosph...${build (line 3258) Connected Tue Feb 09 2016 13:12:44 GMT+0100 (CET) Atmosphere: Firing onOpen atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: websocket.onclose atmosph...${build (line 3258) Websocket closed, reason: Normal closure; the connection successfully completed whatever purpose for which it was created. - wasClean: true atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: Firing onClose (closed case) atmosph...${build (line 3258) Connection closed websocket Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: Request already closed, not firing onClose (closed case) atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: invoking .close() on WebSocket object atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: Firing onReconnect atmosph...${build (line 3258) Reconnecting 1 Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: Firing onReconnect atmosph...${build (line 3258) Invoking executeWebSocket, using URL: ws://localhost:8080/websocket?X-Atmosphere-tracking-id=d38da3cf-fb27-47f7-b86d-4e9f12391232&X-Atmosphere-Framework=2.3.1-javascript&X-Atmosphere-Transport=websocket&Content-Type=application/json&X-atmo-protocol=true atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: websocket.onopen atmosph...${build (line 3258) Websocket successfully opened atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: websocket.onmessage atmosph...${build (line 3258) Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: Firing onReopen atmosph...${build (line 3258) Reopen Tue Feb 09 2016 13:13:13 GMT+0100 (CET) Atmosphere: Firing onReopen