如何关闭由以下代码打开的连接:
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL)
androidHttpTransport.call(soap_action, envelope);
httptransportse是ksoap2库中定义的类。
最佳答案
if(httpTransport!=null){
httpTransport.reset();
try {
httpTransport.getConnection().disconnect();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}