private void sendCommand()

in src/main/java/org/apache/sling/maven/projectsupport/ControlListener.java [175:199]


    private void sendCommand(String command) {
        if (socketAddress != null) {
            Socket socket = null;
            try {
                socket = new Socket();
                socket.connect(socketAddress);
                writeLine(socket, command);
                String result = readLine(socket);
                log.info("Sent '" + command + "' to " + socketAddress + ": " + result, null);
            } catch (ConnectException ce) {
                log.info("No Sling running at " + socketAddress, null);
            } catch (IOException ioe) {
                log.error("Failed sending '" + command + "' to " + socketAddress, ioe);
            } finally {
                if (socket != null) {
                    try {
                        socket.close();
                    } catch (IOException ignore) {
                    }
                }
            }
        } else {
            log.info("No socket address to send '" + command + "' to", null);
        }
    }