FileDocCategorySizeDatePackage
Connect.javaAPI DocExample604Tue Mar 13 15:32:38 GMT 2001None

Connect

public class Connect extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		String server_name = "localhost";

		try {
			Socket sock = new Socket(server_name, 80);

			/* Finally, we can read and write on the socket. */
			System.out.println(" *** Connected to " + server_name  + " ***");
			/* ... */

			sock.close();

		} catch (java.io.IOException e) {
			System.err.println("error connecting to " + 
				server_name + ": " + e);
			return;
		}