Client:
out.output(doc,System.out); <-----------------------为什么要输出到System.out?你要非这么写,至少在前边写上 System.setOut(new PrintWriter(new BufferedOutputStream(dos))));

解决方案 »

  1.   

    sorry 看错了,你的这个问题是因为你没有在s.getOutputStream().flush();后调用s.shutDownOutput();这样的话,服务器端的parser认为输入流没有结束,所以无法继续parse。
      

  2.   

    但是,如果我调用s.shutDownOutput();之后  服务端的s.getOutputStream();出错,提示socket已经关闭。这样我没法返回了。不知什么原因。
      

  3.   

    你可以在socket建立的时候获得OutputStream