diff --git a/src/main/java/com/github/nkzawa/socketio/client/IO.java b/src/main/java/com/github/nkzawa/socketio/client/IO.java index 6502dd7..1a0ee49 100644 --- a/src/main/java/com/github/nkzawa/socketio/client/IO.java +++ b/src/main/java/com/github/nkzawa/socketio/client/IO.java @@ -8,10 +8,13 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Logger; public class IO { + private static final Logger logger = Logger.getLogger(IO.class.getName()); + private static final ConcurrentHashMap managers = new ConcurrentHashMap(); /** @@ -53,15 +56,17 @@ public class IO { } catch (MalformedURLException e) { throw new URISyntaxException(uri.toString(), e.getMessage()); } - URI href = parsed.toURI(); + URI source = parsed.toURI(); Manager io; if (opts.forceNew || !opts.multiplex) { - io = new Manager(href, opts); + logger.info(String.format("ignoring socket cache for %s", source)); + io = new Manager(source, opts); } else { String id = Url.extractId(parsed); if (!managers.containsKey(id)) { - managers.putIfAbsent(id, new Manager(href, opts)); + logger.info(String.format("new io instance for %s", source)); + managers.putIfAbsent(id, new Manager(source, opts)); } io = managers.get(id); }