Instead of URLConnection, and call disconnect() at the end.
It may help closing too many open files exception on iOS.
May 09, 2018 8:17:35 AM com.gluonhq.impl.maps.tile.osm.CachedOsmTileRetriever
SEVERE: null
java.net.SocketException: Too many open files
at java.lang.Throwable.fillInStackTrace(Unknown Source)
at java.lang.Throwable.<init>(Unknown Source)
at java.lang.Exception.<init>(Unknown Source)
at java.io.IOException.<init>(Unknown Source)
at java.net.SocketException.<init>(Unknown Source)
at java.net.Socket.createImpl(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.gluonhq.impl.maps.tile.osm.CachedOsmTileRetriever$CacheThread.doCache(Unknown Source)
at com.gluonhq.impl.maps.tile.osm.CachedOsmTileRetriever$CacheThread.run(Unknown Source)
Instead of
URLConnection
, and calldisconnect()
at the end.It may help closing too many open files exception on iOS.