From 617ab95ede3e3b46ce1b5d96c57b3191a2f59b6e Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 4 Apr 2018 16:16:31 +0200 Subject: [PATCH] Added isConnected() method back to the client --- src/dorkbox/network/Client.java | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/dorkbox/network/Client.java b/src/dorkbox/network/Client.java index 0e33faf3..7ff62cfc 100644 --- a/src/dorkbox/network/Client.java +++ b/src/dorkbox/network/Client.java @@ -479,25 +479,16 @@ class Client extends EndPointClient implements Connection public void close() { closeConnection(); + } - // String threadName = Client.class.getSimpleName(); - // synchronized (bootstraps) { - // ArrayList newList = new ArrayList(bootstraps.size()); - // - // for (BootstrapWrapper bootstrap : bootstraps) { - // EventLoopGroup group = bootstrap.bootstrap.group(); - // - // removeFromShutdown(group); - // group.shutdownGracefully(); - // - // String name = threadName + "-" + bootstrap.type + "-BOSS"; - // - // newList.add(bootstrap.clone(newEventLoop(1, name))); - // } - // - // bootstraps.clear(); - // bootstraps.addAll(newList); - // } + /** + * Checks to see if this client has connected yet or not. + * + * @return true if we are connected, false otherwise. + */ + public + boolean isConnected() { + return super.isConnected.get(); } }