Added better handling of WebSocketHandler polling.