U++ framework
Do not panic. Ask here before giving up.

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 Go to previous message
captainc is currently offline  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.
 
Read Message
Read Message
Previous Topic: Get list of open files.
Next Topic: ImageCtrl issue
Goto Forum:
  


Current Time: Fri May 15 04:28:34 GMT+2 2026

Total time taken to generate the page: 0.00489 seconds