|
@@ -246,16 +246,17 @@ public class SysAppUtil {
|
|
|
.map(new Func1<Integer, Integer>() {
|
|
.map(new Func1<Integer, Integer>() {
|
|
|
@Override
|
|
@Override
|
|
|
public Integer call(Integer integer) {
|
|
public Integer call(Integer integer) {
|
|
|
- int result = -1;
|
|
|
|
|
- Runtime runtime = Runtime.getRuntime();
|
|
|
|
|
- try {
|
|
|
|
|
- Process p = runtime.exec("ping -c 1 -w 2 www.baidu.com");//-c 1,表示只发送一个icmp echo_request 包 -w 1 表示等待1s
|
|
|
|
|
- result = p.waitFor();
|
|
|
|
|
- LogUtil.println("ping", "Process:"+result);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return result;
|
|
|
|
|
|
|
+// int result = -1;
|
|
|
|
|
+// Runtime runtime = Runtime.getRuntime();
|
|
|
|
|
+// try {
|
|
|
|
|
+// Process p = runtime.exec("ping -c 1 -w 2 www.baidu.com");//-c 1,表示只发送一个icmp echo_request 包 -w 1 表示等待1s
|
|
|
|
|
+// result = p.waitFor();
|
|
|
|
|
+// LogUtil.println("ping", "Process:"+result);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// return result;
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.subscribeOn(Schedulers.io())
|
|
.subscribeOn(Schedulers.io())
|