Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Using StartProcess with ping
Re: Using StartProcess with ping [message #15621 is a reply to message #15620] |
Thu, 01 May 2008 17:39  |
captainc
Messages: 278 Registered: December 2006 Location: New Jersey, USA
|
Experienced Member |
|
|
Found out through some testing that I had to call the Read() method during the loop in order to have the SlaveProcess recognize that it was finished.
int Ping(){
String ret; // <-- Added this line
String cmdline = "ping -n 3 192.168.0.1";
One<SlaveProcess> sp = StartProcess(cmdline);
while(sp->IsRunning()){
Sleep(200);
sp->Read(ret); // <-- Added this line
}
return sp->GetExitCode();
}
This works now.
|
|
|
Goto Forum:
Current Time: Wed Aug 27 00:14:12 CEST 2025
Total time taken to generate the page: 0.05114 seconds
|