成都公司:成都市成华区建设南路160号1层9号
重庆公司:重庆市江北区红旗河沟华创商务大厦18楼
如何建立持久HTTP连接
下面的代码写在doGet或者doPost中:
response.setContentType("text/html; charset=GBK");
String result = "";
DataOutputStream ds = new DataOutputStream(response.getOutputStream());
while(true){
try{
result = "中文字符串ABC";
ds.write(result.getBytes());
ds.flush();
}catch(IOException e){
break; }
try{Thread.sleep(1000);}
catch(InterruptedException ex){}
}

