?? prueba.c
字號:
/******************************************************************************//* This file has been written by Sergio Perez Alca駃z <serpeal@upvnet.upv.es> *//* Departamento de Inform醫ica de Sistemas y Computadores *//* Universidad Polit閏nica de Valencia *//* Valencia (Spain) *//* *//* The RTL-lwIP project has been supported by the Spanish Government Research *//* Office (CICYT) under grant TIC2002-04123-C03-03 *//******************************************************************************/#include <stdlib.h>#include <unistd.h>#include <time.h>int main(int argc, char *argv[]) { int i; int max_iterations = 1000; struct timespec time; char tcporder[]="./tcpClient 158.42.58.141 Hello_baby"; char udporder[]="./udpClient 158.42.58.141 Hello_baby"; char command[60]; time.tv_sec = 0; time.tv_nsec = 50000; if(argc == 2) max_iterations = atoi(argv[1]); for(i=0; i< max_iterations; i++){ sprintf( &command[0],"%s%d %s", tcporder, i, "> /dev/null"); if(system(&command[0])==-1) break; sprintf( &command[0],"%s%d %s", udporder, i, "> /dev/null"); if(system(&command[0])==-1) break; } return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -