Example #1
0
 private static Socket getSocket() throws UnknownHostException, IOException {
   Socket s = (Socket) sockPool.get();
   if (s == null || s.isClosed()) {
     logger.debug("s==null is " + (s == null));
     if (s != null) logger.debug("is closed:" + s.isClosed());
     s = reconnect();
     sockPool.set(s);
   }
   logger.info("Socket={}", s.hashCode());
   return s;
 }