1. our program need to ping a host repeatly , but it hang after
executing for some times . the concrete ping code is:
ProcessBuilder processBuilder=new ProcessBuilder();
Process process = processBuilder.command("ping","-W","1","-
c","20","www.google.com").redirectErrorStream(true).start();
BufferedReader bufferReader = new BufferedReader(new
InputStreamReader(process.getInputStream(),"GBK"));
String readline;
while ((readline = bufferReader.readLine()) != null) {
Log.i("PING", "result : " + readline);
}
2. In the first,we suspect our code has bugs , so we execute "ping -c
20 -W 1 www.google.com" in the adb shell repeatly by hand ,after
dozens of times , the shell hang ,and we can not login another shell .
3. When I execute "ping -c 20 -W 1 127.0.0.1" , because it ping
successfully every time ,the program seems can work forever
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment