<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FNetwork_Protocol%2FVarious_Clients</id>
		<title>Java/Network Protocol/Various Clients - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FNetwork_Protocol%2FVarious_Clients"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Network_Protocol/Various_Clients&amp;action=history"/>
		<updated>2026-04-10T09:07:23Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/Network_Protocol/Various_Clients&amp;diff=8907&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Network_Protocol/Various_Clients&amp;diff=8907&amp;oldid=prev"/>
				<updated>2010-06-01T07:21:17Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 07:21, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/Network_Protocol/Various_Clients&amp;diff=8906&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Network_Protocol/Various_Clients&amp;diff=8906&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Multicast Client ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* From http://java.sun.ru/docs/books/tutorial/index.html */&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution of source code must retain the above copyright notice, this&lt;br /&gt;
 *  list of conditions and the following disclaimer.&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution in binary form must reproduce the above copyright notice,&lt;br /&gt;
 *  this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
 *  and/or other materials provided with the distribution.&lt;br /&gt;
 *&lt;br /&gt;
 * Neither the name of Sun Microsystems, Inc. or the names of contributors may&lt;br /&gt;
 * be used to endorse or promote products derived from this software without&lt;br /&gt;
 * specific prior written permission.&lt;br /&gt;
 *&lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING&lt;br /&gt;
 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;
 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (&amp;quot;SUN&amp;quot;)&lt;br /&gt;
 * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE&lt;br /&gt;
 * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS&lt;br /&gt;
 * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST&lt;br /&gt;
 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,&lt;br /&gt;
 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY&lt;br /&gt;
 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,&lt;br /&gt;
 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 *&lt;br /&gt;
 * You acknowledge that this software is not designed, licensed or intended&lt;br /&gt;
 * for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 * nuclear facility.&lt;br /&gt;
 */&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.net.DatagramPacket;&lt;br /&gt;
import java.net.InetAddress;&lt;br /&gt;
import java.net.MulticastSocket;&lt;br /&gt;
public class MulticastClient {&lt;br /&gt;
  public static void main(String[] args) throws IOException {&lt;br /&gt;
    MulticastSocket socket = new MulticastSocket(4446);&lt;br /&gt;
    InetAddress address = InetAddress.getByName(&amp;quot;230.0.0.1&amp;quot;);&lt;br /&gt;
    socket.joinGroup(address);&lt;br /&gt;
    DatagramPacket packet;&lt;br /&gt;
    // get a few quotes&lt;br /&gt;
    for (int i = 0; i &amp;lt; 5; i++) {&lt;br /&gt;
      byte[] buf = new byte[256];&lt;br /&gt;
      packet = new DatagramPacket(buf, buf.length);&lt;br /&gt;
      socket.receive(packet);&lt;br /&gt;
      String received = new String(packet.getData());&lt;br /&gt;
      System.out.println(&amp;quot;Quote of the Moment: &amp;quot; + received);&lt;br /&gt;
    }&lt;br /&gt;
    socket.leaveGroup(address);&lt;br /&gt;
    socket.close();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/////////////////////////////////////////////////&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.FileNotFoundException;&lt;br /&gt;
import java.io.FileReader;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.net.DatagramPacket;&lt;br /&gt;
import java.net.DatagramSocket;&lt;br /&gt;
import java.net.InetAddress;&lt;br /&gt;
import java.util.Date;&lt;br /&gt;
public class MulticastServer {&lt;br /&gt;
  public static void main(String[] args) throws java.io.IOException {&lt;br /&gt;
    new MulticastServerThread().start();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
class MulticastServerThread extends QuoteServerThread {&lt;br /&gt;
  private long FIVE_SECONDS = 5000;&lt;br /&gt;
  public MulticastServerThread() throws IOException {&lt;br /&gt;
    super(&amp;quot;MulticastServerThread&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  public void run() {&lt;br /&gt;
    while (moreQuotes) {&lt;br /&gt;
      try {&lt;br /&gt;
        byte[] buf = new byte[256];&lt;br /&gt;
        // construct quote&lt;br /&gt;
        String dString = null;&lt;br /&gt;
        if (in == null)&lt;br /&gt;
          dString = new Date().toString();&lt;br /&gt;
        else&lt;br /&gt;
          dString = getNextQuote();&lt;br /&gt;
        buf = dString.getBytes();&lt;br /&gt;
        // send it&lt;br /&gt;
        InetAddress group = InetAddress.getByName(&amp;quot;230.0.0.1&amp;quot;);&lt;br /&gt;
        DatagramPacket packet = new DatagramPacket(buf, buf.length,&lt;br /&gt;
            group, 4446);&lt;br /&gt;
        socket.send(packet);&lt;br /&gt;
        // sleep for a while&lt;br /&gt;
        try {&lt;br /&gt;
          sleep((long) (Math.random() * FIVE_SECONDS));&lt;br /&gt;
        } catch (InterruptedException e) {&lt;br /&gt;
        }&lt;br /&gt;
      } catch (IOException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
        moreQuotes = false;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    socket.close();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
class QuoteServerThread extends Thread {&lt;br /&gt;
  protected DatagramSocket socket = null;&lt;br /&gt;
  protected BufferedReader in = null;&lt;br /&gt;
  protected boolean moreQuotes = true;&lt;br /&gt;
  public QuoteServerThread() throws IOException {&lt;br /&gt;
    this(&amp;quot;QuoteServerThread&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  public QuoteServerThread(String name) throws IOException {&lt;br /&gt;
    super(name);&lt;br /&gt;
    socket = new DatagramSocket(4445);&lt;br /&gt;
    try {&lt;br /&gt;
      in = new BufferedReader(new FileReader(&amp;quot;one-liners.txt&amp;quot;));&lt;br /&gt;
    } catch (FileNotFoundException e) {&lt;br /&gt;
      System.err&lt;br /&gt;
          .println(&amp;quot;Could not open quote file. Serving time instead.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public void run() {&lt;br /&gt;
    while (moreQuotes) {&lt;br /&gt;
      try {&lt;br /&gt;
        byte[] buf = new byte[256];&lt;br /&gt;
        // receive request&lt;br /&gt;
        DatagramPacket packet = new DatagramPacket(buf, buf.length);&lt;br /&gt;
        socket.receive(packet);&lt;br /&gt;
        // figure out response&lt;br /&gt;
        String dString = null;&lt;br /&gt;
        if (in == null)&lt;br /&gt;
          dString = new Date().toString();&lt;br /&gt;
        else&lt;br /&gt;
          dString = getNextQuote();&lt;br /&gt;
        buf = dString.getBytes();&lt;br /&gt;
        // send the response to the client at &amp;quot;address&amp;quot; and &amp;quot;port&amp;quot;&lt;br /&gt;
        InetAddress address = packet.getAddress();&lt;br /&gt;
        int port = packet.getPort();&lt;br /&gt;
        packet = new DatagramPacket(buf, buf.length, address, port);&lt;br /&gt;
        socket.send(packet);&lt;br /&gt;
      } catch (IOException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
        moreQuotes = false;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    socket.close();&lt;br /&gt;
  }&lt;br /&gt;
  protected String getNextQuote() {&lt;br /&gt;
    String returnValue = null;&lt;br /&gt;
    try {&lt;br /&gt;
      if ((returnValue = in.readLine()) == null) {&lt;br /&gt;
        in.close();&lt;br /&gt;
        moreQuotes = false;&lt;br /&gt;
        returnValue = &amp;quot;No more quotes. Goodbye.&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
    } catch (IOException e) {&lt;br /&gt;
      returnValue = &amp;quot;IOException occurred in server.&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    return returnValue;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
//file: one-liners.txt&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Life is wonderful. Without it we&amp;quot;d all be dead.&lt;br /&gt;
Daddy, why doesn&amp;quot;t this magnet pick up this floppy disk?&lt;br /&gt;
Give me ambiguity or give me something else.&lt;br /&gt;
I.R.S.: We&amp;quot;ve got what it takes to take what you&amp;quot;ve got!&lt;br /&gt;
We are born naked, wet and hungry. Then things get worse.&lt;br /&gt;
Make it idiot proof and someone will make a better idiot.&lt;br /&gt;
He who laughs last thinks slowest!&lt;br /&gt;
Always remember you&amp;quot;re unique, just like everyone else.&lt;br /&gt;
&amp;quot;More hay, Trigger?&amp;quot; &amp;quot;No thanks, Roy, I&amp;quot;m stuffed!&amp;quot;&lt;br /&gt;
A flashlight is a case for holding dead batteries.&lt;br /&gt;
Lottery: A tax on people who are bad at math.&lt;br /&gt;
Error, no keyboard - press F1 to continue.&lt;br /&gt;
There&amp;quot;s too much blood in my caffeine system.&lt;br /&gt;
Artificial Intelligence usually beats real stupidity.&lt;br /&gt;
Hard work has a future payoff. Laziness pays off now.&lt;br /&gt;
&amp;quot;Very funny, Scotty. Now beam down my clothes.&amp;quot;&lt;br /&gt;
Puritanism: The haunting fear that someone, somewhere may be happy.&lt;br /&gt;
Consciousness: that annoying time between naps.&lt;br /&gt;
Don&amp;quot;t take life too seriously, you won&amp;quot;t get out alive.&lt;br /&gt;
I don&amp;quot;t suffer from insanity. I enjoy every minute of it.&lt;br /&gt;
Better to understand a little than to misunderstand a lot.&lt;br /&gt;
The gene pool could use a little chlorine.&lt;br /&gt;
When there&amp;quot;s a will, I want to be in it.&lt;br /&gt;
Okay, who put a &amp;quot;stop payment&amp;quot; on my reality check?&lt;br /&gt;
We have enough youth, how about a fountain of SMART?&lt;br /&gt;
Programming is an art form that fights back.&lt;br /&gt;
&amp;quot;Daddy, what does FORMATTING DRIVE C mean?&amp;quot;&lt;br /&gt;
All wiyht. Rho sritched mg kegtops awound?&lt;br /&gt;
My mail reader can beat up your mail reader.&lt;br /&gt;
Never forget: 2 + 2 = 5 for extremely large values of 2.&lt;br /&gt;
Nobody has ever, ever, EVER learned all of WordPerfect.&lt;br /&gt;
To define recursion, we must first define recursion.&lt;br /&gt;
Good programming is 99% sweat and 1% coffee.&lt;br /&gt;
Home is where you hang your @&lt;br /&gt;
The E-mail of the species is more deadly than the mail.&lt;br /&gt;
A journey of a thousand sites begins with a single click.&lt;br /&gt;
You can&amp;quot;t teach a new mouse old clicks.&lt;br /&gt;
Great groups from little icons grow.&lt;br /&gt;
Speak softly and carry a cellular phone.&lt;br /&gt;
C:\ is the root of all directories.&lt;br /&gt;
Don&amp;quot;t put all your hypes in one home page.&lt;br /&gt;
Pentium wise; pen and paper foolish.&lt;br /&gt;
The modem is the message.&lt;br /&gt;
Too many clicks spoil the browse.&lt;br /&gt;
The geek shall inherit the earth.&lt;br /&gt;
A chat has nine lives.&lt;br /&gt;
Don&amp;quot;t byte off more than you can view.&lt;br /&gt;
Fax is stranger than fiction.&lt;br /&gt;
What boots up must come down.&lt;br /&gt;
Windows will never cease.   (ed. oh sure...)&lt;br /&gt;
In Gates we trust.    (ed.  yeah right....)&lt;br /&gt;
Virtual reality is its own reward.&lt;br /&gt;
Modulation in all things.&lt;br /&gt;
A user and his leisure time are soon parted.&lt;br /&gt;
There&amp;quot;s no place like http://www.home.ru&lt;br /&gt;
Know what to expect before you connect.&lt;br /&gt;
Oh, what a tangled website we weave when first we practice.&lt;br /&gt;
Speed thrills.&lt;br /&gt;
Give a man a fish and you feed him for a day; teach him to use the Net and he won&amp;quot;t bother you for weeks.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== This finger client allows you to query a remote host. ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*       &lt;br /&gt;
Chapter 3 - Simple Protocols&lt;br /&gt;
Java 2 Network Protocols Black Book&lt;br /&gt;
by Al Williams    &lt;br /&gt;
Paraglyph Press 2001&lt;br /&gt;
*/&lt;br /&gt;
import java.net.*;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
public class Finger {&lt;br /&gt;
    public String finger(String host, String users) &lt;br /&gt;
       throws IOException, SocketException {&lt;br /&gt;
       String outstring=&amp;quot;&amp;quot;;&lt;br /&gt;
       int c=0;&lt;br /&gt;
       Socket sock=new Socket(host,79);&lt;br /&gt;
       OutputStream os = sock.getOutputStream();&lt;br /&gt;
       InputStream is = sock.getInputStream();&lt;br /&gt;
       users = users + &amp;quot;\r\n&amp;quot;;&lt;br /&gt;
       os.write(users.getBytes(&amp;quot;iso8859_1&amp;quot;));&lt;br /&gt;
       try {&lt;br /&gt;
           while (c!=-1) {&lt;br /&gt;
             c=is.read();&lt;br /&gt;
             if (c!=-1) outstring+=(char)c;&lt;br /&gt;
           }&lt;br /&gt;
       }&lt;br /&gt;
       catch (IOException e) {}&lt;br /&gt;
       return outstring;&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
    &lt;br /&gt;
       String hostname = &amp;quot;&amp;quot;;&lt;br /&gt;
       String ulist = &amp;quot;&amp;quot;;&lt;br /&gt;
       if (args.length==0) {&lt;br /&gt;
           System.out.println(&amp;quot;usage: finger host [user]&amp;quot;);&lt;br /&gt;
           System.exit(1);&lt;br /&gt;
       }&lt;br /&gt;
       if (args.length&amp;gt;=2) &lt;br /&gt;
           for (int i=1; i&amp;lt;args.length; i++) &lt;br /&gt;
             ulist+=args[i]+&amp;quot; &amp;quot;;&lt;br /&gt;
       hostname=args[0];&lt;br /&gt;
       Finger worker = new Finger();&lt;br /&gt;
       try {&lt;br /&gt;
         System.out.println(worker.finger(hostname,ulist.trim()));&lt;br /&gt;
       }&lt;br /&gt;
       catch (Exception e) {&lt;br /&gt;
           System.out.println(e);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== This whois client defaults to the whois.internic.net server ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
Chapter 3 - Simple Protocols&lt;br /&gt;
Java 2 Network Protocols Black Book&lt;br /&gt;
by Al Williams    &lt;br /&gt;
Paraglyph Press 2001&lt;br /&gt;
*/&lt;br /&gt;
import java.net.*;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
public class Whois {&lt;br /&gt;
    public void whois(String query) throws IOException {&lt;br /&gt;
    whois(query,&amp;quot;whois.internic.net&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public String whois(String query, String server) throws IOException {&lt;br /&gt;
       Socket sock = new Socket(server,43);&lt;br /&gt;
       int c=0;&lt;br /&gt;
       String outstring=&amp;quot;&amp;quot;;&lt;br /&gt;
       OutputStream os = sock.getOutputStream();&lt;br /&gt;
       InputStream is = sock.getInputStream();&lt;br /&gt;
       query += &amp;quot;\r\n&amp;quot;;&lt;br /&gt;
       os.write(query.getBytes(&amp;quot;iso8859_1&amp;quot;));&lt;br /&gt;
       try {&lt;br /&gt;
           while (c!=-1) {&lt;br /&gt;
             c=is.read();&lt;br /&gt;
             if (c!=-1) outstring+=(char)c;&lt;br /&gt;
           }&lt;br /&gt;
       }&lt;br /&gt;
       catch (IOException e) {}&lt;br /&gt;
       return outstring;&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
       String hostname = &amp;quot;&amp;quot;;&lt;br /&gt;
       String ulist = &amp;quot;&amp;quot;;&lt;br /&gt;
       if (args.length==0) {&lt;br /&gt;
           System.out.println(&amp;quot;usage: whois [%host] query&amp;quot;);&lt;br /&gt;
           System.exit(1);&lt;br /&gt;
       }&lt;br /&gt;
       int argn=0;&lt;br /&gt;
       hostname=&amp;quot;whois.networksolutions.ru&amp;quot;; // default&lt;br /&gt;
       if (args.length&amp;gt;1 &amp;amp;&amp;amp; args[0].charAt(0)==&amp;quot;%&amp;quot;) {&lt;br /&gt;
           hostname=args[argn].substring(1);&lt;br /&gt;
            argn++;&lt;br /&gt;
       }&lt;br /&gt;
        for (int i=argn; i&amp;lt;args.length; i++) &lt;br /&gt;
             ulist+=args[i]+&amp;quot; &amp;quot;;&lt;br /&gt;
       Whois worker = new Whois();&lt;br /&gt;
       try {&lt;br /&gt;
           System.out.println(worker.whois(ulist.trim(),hostname));&lt;br /&gt;
       }&lt;br /&gt;
       catch (Exception e) {&lt;br /&gt;
           System.out.println(e);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use Socket to read from whois.internic.net ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.DataInputStream;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.PrintStream;&lt;br /&gt;
import java.net.Socket;&lt;br /&gt;
public class whois {&lt;br /&gt;
  public final static int port = 43;&lt;br /&gt;
  public final static String hostname = &amp;quot;whois.internic.net&amp;quot;;&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Socket theSocket;&lt;br /&gt;
    DataInputStream theWhoisStream;&lt;br /&gt;
    PrintStream ps;&lt;br /&gt;
    try {&lt;br /&gt;
      theSocket = new Socket(hostname, port, true);&lt;br /&gt;
      ps = new PrintStream(theSocket.getOutputStream());&lt;br /&gt;
      for (int i = 0; i &amp;lt; args.length; i++) ps.print(args[i] + &amp;quot; &amp;quot;);&lt;br /&gt;
      ps.print(&amp;quot;\r\n&amp;quot;);&lt;br /&gt;
      theWhoisStream = new DataInputStream(theSocket.getInputStream());&lt;br /&gt;
      String s;&lt;br /&gt;
      while ((s = theWhoisStream.readLine()) != null) {&lt;br /&gt;
        System.out.println(s);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    catch (IOException e) {&lt;br /&gt;
      System.err.println(e);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>