你的程序没有问题,用其他网址试都是正确的。(http://www.apache.org/index.html)
我这里 http://us01.xmlsearch.findwhat.com/ 这个网址都打不开,应该是你的程序无法
与us01.xmlsearch.findwhat.com的80端口建立连接。
============================================================================
/*
 * Created on 2004-11-12
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package http;import java.net.*;
import java.io.*;public class TestSocket { public static void main(String argv[]) throws Exception {
new TestSocket().get(); } public void get() throws Exception {
final int HTTP_PORT = 80;
InetAddress address = InetAddress
.getByName("www.apache.org");
Socket socket = new Socket(address, HTTP_PORT);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(socket
.getOutputStream()));
BufferedReader in = new BufferedReader(new InputStreamReader(socket
.getInputStream()));

String httpGet="GET http://www.apache.org/index.html HTTP/1.0\r\n"
+ "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*\r\n"
+ "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)\r\n"
+ "Host: www.apache.org\r\n\r\n";

out.write(httpGet);

out.flush(); String line;
//StringBuffer sb = new StringBuffer();
while ((line = in.readLine()) != null) {
//sb.append(line);
System.out.println(line);
}
out.close();
in.close();
socket.close();
//System.out.println(sb.toString());
}}==============================================================返回内容:HTTP/1.1 200 OK
Date: Fri, 12 Nov 2004 11:00:25 GMT
Server: Apache/2.0.52 (Unix)
Last-Modified: Mon, 18 Oct 2004 00:38:27 GMT
ETag: "2da7cde-2e53-feb2e6c0"
Accept-Ranges: bytes
Content-Length: 11859
Cache-Control: max-age=86400
Expires: Sat, 13 Nov 2004 11:00:25 GMT
Connection: close
Content-Type: text/html; charset=ISO-8859-1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Copyright 1999-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
 <head>
  。