/**
  * Closes a connection to the supplied remote address, if it is open. This method is particularly
  * useful when not using a timeout for remote connections.
  *
  * @param remoteAddress the address of the peer socket.
  * @return <code>true</code> if the connection has been closed and <code>false</code> if there was
  *     nothing to close.
  * @since 1.7.1
  */
 public synchronized boolean close(Address remoteAddress) throws IOException {
   if (logger.isDebugEnabled()) {
     logger.debug("Closing socket for peer address " + remoteAddress);
   }
   SocketEntry entry = (SocketEntry) sockets.remove(remoteAddress);
   if (entry != null) {
     synchronized (entry) {
       entry.getSocket().close();
     }
     logger.info("Socket to " + entry.getPeerAddress() + " closed");
     return true;
   }
   return false;
 }