Java Bikin Tangan Gatel juga..

Posted: 2 Februari 2008 in Uncategorized

gini gini.. sekarang ni aku lagi mikir gimana caranya bikin network monitoring system sendiri

kemudian setalah pikir2. aku pengen nyoba pake java. karena belom pernah nyoba java hehehe😀

nah code ini udah ditest n bikin penasaran begadang merenungi pribahasa “Java bisa apa sih?”

import java.io.*;
import java.net.*;

public class ReachableTest {
public static void main(String args[]) {
try {
InetAddress address = InetAddress.getByName(“r1-ska.radio.dishubpku.net”);
System.out.println(“Name: ” + address.getHostName());
System.out.println(“Addr: ” + address.getHostAddress());
System.out.println(“Reach: ” + address.isReachable(3000));
}
catch (UnknownHostException e) {
System.err.println(“Unable to lookup r1-ska.radio.dishubpku.net”);
}
catch (IOException e) {
System.err.println(“Unable to reach r1-ska.radio.dishubpku.net”);
}
}
}

trus dicompile

debian:~# javac ReachableTest.java

trus dijalanin

debian:~# java ReachableTest
Name: r1-ska.radio.dishubpku.net
Addr: 172.16.20.197
Reach: true

trus kok bisa cepet banget ya? ah jadi penasaran.. berapa lama ya kalo 200 host yang dia test?

Komentar
  1. kentrap01 mengatakan:

    tulisan apaan nih
    cape deh gua bacanya
    hih
    hihihihihihihih
    =)

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s