Socket s = new Socket("whois.krnic.net",43);
InputStream in = s.getInputStream();
OutputStream out = s.getOutputStream();
out.write("hufs.ac.kr\n".getBytes());
out.flush();
byte[] bt = new byte[1000];
while(true){
int n;
n = in.read(bt);
if(n==-1) break;
System.out.print(new String(bt,0,n));
}
in.close();
s.close();
댓글 없음:
댓글 쓰기