Creating a Client Socket try { InetAddress addr = InetAddress.getByName( "java.sun.com"); int port = 80; Socket sock = new Socket(addr, port); } catch (IOException e) { }