How to Exit a Process (.exec()) if the External Program hangs
问题 Let me explain my software. What my software simply does is that it creates 10 threads and assigns a number of tasks to each thread. Each thread then creates a Runtime Process that will start a cmd batch file which in turn will start a program that will telnet to a device (I have about 200 of them) to poll its configuration. Here is the code for my process creation: Process p1 = java.lang.Runtime.getRuntime().exec("cmd /c start /b /wait " + batchFile); int returnVal = p1.waitFor(); batchFile