偶在solaris 5.8+JDK1.4.2下试了,没啥问题。
连的是本机的80端口。

解决方案 »

  1.   

    很高兴看到你的回应.你测试了多长时间.另外我机器的信息
    SunOS xxx 5.8 Generic_108528-14 sun4u sparc SUNW,Netra-T4JDK信息
    java version "1.4.2_01"
      

  2.   

    2万条跑完了。只知道是SunOS 5.8  sparc JDK1.4.0_02-b02
      

  3.   

    向楼主通报一下,SunOS 5.8 JDK1.4.2_04-b05下也跑了一轮(2万条跑完),没问题。
      

  4.   

    用1.4.0(java version "1.4.0_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_02-b02)
    Java HotSpot(TM) Client VM (build 1.4.0_02-b02, mixed mode))
    还是有问题, 你能用uname -a 看一下你系统的信息吗.
    另外我用的接收程序是这样的
    import java.io.*;
    import java.util.*;
    import java.net.*;class MyCollector
    {

    public static void main(String args[]) {
    System.out.println("Starting MyCollector..."); try
    {
    ServerSocket svrSocket = new ServerSocket(10035,200);
    Socket socket = null;
       while( ( socket= svrSocket.accept())!= null)
       {
                            ConnectionHandler handler = new 
    ConnectionHandler(socket);
    (new Thread(handler)).start();
    socket = null;
    }
           }
         catch(Exception e)
         {
              e.printStackTrace();
        }
        
        System.out.println("hello");
       }}
    class ConnectionHandler implements Runnable
    {
    static int replyCount = 0;
    static int recvCount= 0;

    static Object statLock = new Object();

    private Socket connection = null;

    ConnectionHandler(Socket connection)
    {
    this.connection = connection;
    } public void run()
    { try
    {
        
         synchronized(statLock)
         {
        
         recvCount++;
         if(recvCount % 100 == 0)
          System.out.println("recv : " + recvCount);
         }
         int c =0;
    InputStream inbound = connection.getInputStream();
    int count=0;
    while ((c = inbound.read()) > 0)
    {
    if(count++ >500)
    break;
    }
    PrintWriter outWriter = new 
    PrintWriter(connection.getOutputStream());
    outWriter.println("HTTP/1.1 200 OK");
    outWriter.println("Content-Length: 0");
    outWriter.println("Server: Apache-Coyote/1.1");
    outWriter.println("Connection: close");
    outWriter.flush();

    outWriter.close();

    synchronized(statLock)
         {
        
         replyCount++;
         if(replyCount % 100 == 0)
          System.out.println("reply : " + replyCount);
         }
        
         }
         catch(Exception e)
         {
         e.printStackTrace();
         }
        }
     }
    //end MyCollector.java你可以试一下吗?
      

  5.   

    另外你的系统有没有安装solaris 的patch
      

  6.   

    uname -a 输出
    SunOS oss-server 5.8 Generic_108528-21 sun4u sparc SUNW,Ultra-60
    你也可以先连一下本机的80端口试一下。好像跟服务端很有关系,我连tomcat就不行。
    我再试下你的服务端。
      

  7.   

    我连接本地的apache 8080端口还是有问题的