import java.net.InetAddress;
import java.net.Socket;
public class testSocket {
    private static Socket socket;
    public static void main(String args[])
    {
        try {
            String host = args[0];  //?? localhost hoare.cs.umsl.edu
            int port =Integer.parseInt(args[1]);  // ?? 8080 8009
            InetAddress address = InetAddress.getByName(host);
            socket = new Socket(host, port);
            System.out.println(address);

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            //Closing the socket
            try {
                socket.close();
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
}


On hoare.cs.umsl.edu

Off hoare.cs.umsl.edu


Firefox on hoare.cs.umsl.edu