为什么要开这么多线程??
开一个线程,含有包括ServerSocket监听即可。
把接受到的客户端Socket流添加到线程池当中。

解决方案 »

  1.   

    不要强制stop线程,用Thread.interrupt()方法,然后在wait的catch块中,用Thread.interrupted() 判断是否被中断,如果是就用s.close()关闭ServerSocket.
      

  2.   

    开这么多线程是为了响应并发的访问。
    而且每一次线程的destory都要占用大量资源。。所以做了个死循环。
    我已解决了
      

  3.   

    如果你用JDK1.4以上版本,建议使用异步IO,然后固定线程数目,做线程池,(使用Dispatch Thread/Worker Thread模式)开过多的线程(进程)会严重影响效率。
      

  4.   

    As Mark said, only one thread should be listening.
    and upon receiving a request, just get thread from a thread pool.http://www.csdn.net/expert/topic/1020/1020206.xml?temp=.7987024