1.  8000
2.  查一下 Socket 构造函数的说明就知道了
3.   Server        DataInputStream in=null;
        PrintStream out=null;    Client
  
         BufferedReader in=null;
  PrintWriter out=null;4.    while(!str.equals("quit"))
{
System.out.println("Client said:"+str);
str=in.readLine();
}

解决方案 »

  1.   

    1.  8000
    2.  本地计算机(即自己的机器)
    3.DataInputStream   PrintStream
      BufferedReader    PrintWriter
    4.soc=svrsoc.accept();
      

  2.   

    这是我自己的答案,有一些我不清楚,大家讨论下,好吗
    1。8000
    2.服务端的主机
    3。我不清楚,初学java,分不太清楚这些流,请大家指教
    4.应该是停在try这里,具体是那个语句,我不清楚,请教大家
      

  3.   

    对于第(4)TCP服务器启动后,它停在哪条语句上等待客户端来连接。?while(!str.equals("quit"))
    {
    System.out.println("Client said:"+str);
    str=in.readLine();
    }
    应该是这个解吧?
      

  4.   


    public Socket accept()
                  throws IOException
    Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made. 
    A new Socket s is created and, if there is a security manager, the security manager's checkAccept method is called with s.getInetAddress().getHostAddress() and s.getPort() as its arguments to ensure the operation is allowed. This could result in a SecurityException. 
    楼主多看看javadoc吧
    其实都不难的
      

  5.   

    標准答案﹕
    1.  8000
    2.  用來做服務器的主機
    3.DataInputStream   PrintStream
      BufferedReader    PrintWriter
    4.svrsoc.accept();
      

  6.   

    答案同 jFresH_MaN()(AbsolutelyFresh)(java欣人) 的
      

  7.   

    1.new ServerSocket(8000);8000端口
    2.本地机
    3.DataInputStream   PrintStream
      BufferedReader    PrintWriter
    4.System.out.println("Client said:"+str);
      

  8.   

    1.  8000
    2.  本机
    3.DataInputStream   PrintStream
      BufferedReader    PrintWriter
    4.soc=svrsoc.accept();
      

  9.   

    请大家不要误人子弟!!!不知道就不要乱说,真想骂人!
    localhost是服务器地址(或ip)!!!
      

  10.   

    to:qljsd(我本善良) 
     你也别得意,localhost本来就是本机地址吗,
    只是它所表明的意义是代表服务器地址(或ip)
    别把自己看得太高,不过白痴一个,自欺欺人
      

  11.   

    localhost那个地方的确是用来放服务器地址的,但是你看看他的程序,他的服务器就是本机,所以说本机也没错吧,楼上何必这么激动?
      

  12.   

    我上面的话是对   qljsd(我本善良)  说的,没想到发出来一看,我楼上已经换人了。更正一下
      

  13.   

    此地不宜久留﹐要走了。
    最后提醒﹐不要被localhost這個名詞給騙了。看來之世道不會英語就會少麻煩哦