How to Ping Host in Groovy - Code Snippet

How to perform 'Ping Host' in Groovy.

example.groovy
// Task: Ping Host
// Language: Groovy

def ping_host() {
    // Implementation for Ping Host
    def result = ...; // Initialize variable
    // TODO: Implement core logic here
    // Step 1: Prepare data
    // Step 2: Process Ping Host
    println("Done");
}
AdSense Slot