#include <stdlib.h>
#include <unistd.h>
#include <time.h>
Include dependency graph for prueba.c:
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
|
Definition at line 15 of file prueba.c. References sprintf(), and time.
00015 { 00016 int i; 00017 int max_iterations = 1000; 00018 struct timespec time; 00019 char tcporder[]="./tcpClient 158.42.58.141 Hello_baby"; 00020 char udporder[]="./udpClient 158.42.58.141 Hello_baby"; 00021 char command[60]; 00022 00023 time.tv_sec = 0; 00024 time.tv_nsec = 50000; 00025 00026 if(argc == 2) 00027 max_iterations = atoi(argv[1]); 00028 00029 for(i=0; i< max_iterations; i++){ 00030 sprintf( &command[0],"%s%d %s", tcporder, i, "> /dev/null"); 00031 if(system(&command[0])==-1) break; 00032 sprintf( &command[0],"%s%d %s", udporder, i, "> /dev/null"); 00033 if(system(&command[0])==-1) break; 00034 } 00035 00036 return 0; 00037 } |
Here is the call graph for this function: