Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

prueba.c

Go to the documentation of this file.
00001 /******************************************************************************/
00002 /* This file has been written by Sergio Perez Alcañiz <serpeal@disca.upv.es>  */
00003 /*            Departamento de Informática de Sistemas y Computadores          */
00004 /*            Universidad Politécnica de Valencia                             */
00005 /*            Valencia (Spain)                                                */
00006 /*                                                                            */
00007 /* The RTL-lwIP project has been supported by the Spanish Government Research */
00008 /* Office (CICYT) under grant TIC2002-04123-C03-03                            */
00009 /******************************************************************************/
00010 
00011 #include <stdlib.h>
00012 #include <unistd.h>
00013 #include <time.h>
00014 
00015 int main(int argc, char *argv[]) {
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 }

Generated on Wed Jan 14 12:58:56 2004 for RTL-lwIP-0.4 by doxygen 1.3.4