Last active
December 10, 2015 20:08
-
-
Save jvcleave/4486538 to your computer and use it in GitHub Desktop.
ping in c++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string deviceIP2 = "169.254.175.209"; | |
| string response = ""; | |
| char pipeBuffer[128]; | |
| FILE *pipe; | |
| string command = "ping "+ deviceIP2; | |
| pipe = _popen( command.c_str(), "rt" ); | |
| if( pipe ) | |
| { | |
| while(fgets(pipeBuffer, 128, pipe)) | |
| { | |
| ofLogVerbose() << "pipeBuffer: " << pipeBuffer; | |
| response+=ofToString(pipeBuffer); | |
| } | |
| } | |
| ofLogVerbose() << "COLLECTED OUTPUT IS: " << endl << response; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment