daids是一个ServerSocket 监听 然后accept以后
为什么下面两个都能打出来if(daids.isClosed()) System.out.println("wocao123123123123122345");
if(daids.isConnected()) System.out.println("9888888888888888888888");因为这句话
PrintWriter daout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(daids.getOutputStream(),"gb2312")),true);
有java.net.SocketException: Socket is closed
的错误
可是我觉得应该没关 所以前面加了那么两句话 不过结果很让我不解 。。高手请指教。。
为什么下面两个都能打出来if(daids.isClosed()) System.out.println("wocao123123123123122345");
if(daids.isConnected()) System.out.println("9888888888888888888888");因为这句话
PrintWriter daout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(daids.getOutputStream(),"gb2312")),true);
有java.net.SocketException: Socket is closed
的错误
可是我觉得应该没关 所以前面加了那么两句话 不过结果很让我不解 。。高手请指教。。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货