38,11 → 38,15 |
|
FILE *output_file; |
|
int miss; |
|
void close_and_exit() |
{ |
|
printf("Closing...\n"); |
|
if (miss == 1) printf("Possible error receiving packets !\n"); |
|
fclose(output_file); |
|
exit(0); |
51,7 → 55,7 |
|
int main(int argc, char *argv[]) |
{ |
int sd, rc, n, cliLen; |
int sd, rc, n, cliLen,count; |
struct sockaddr_in cliAddr, servAddr; |
char msg[MAX_MSG]; |
|
90,6 → 94,9 |
|
signal(SIGINT, close_and_exit); |
|
count = 1; |
miss = 0; |
|
while(1) { |
|
printf("Wait packet...\n"); |
101,6 → 108,13 |
printf("Received %d, length %d(%d), %d tracer events.\n", |
pkt_head->pkt_number, n, pkt_head->size, pkt_head->events); |
|
if (pkt_head->pkt_number != count) { |
printf("Miss Packet !!!\n"); |
miss = 1; |
} |
|
count++; |
|
if(n < 0) { |
printf("%s: cannot receive data \n",argv[0]); |
continue; |