Skip to content

Commit

Permalink
aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Zaman committed Mar 24, 2014
1 parent 967db96 commit 013bd74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion recive.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ int main(){

int64_t time_start;
for(int i=0;;i++){
recvfrom(s, buf, buf_size, 0, (struct sockaddr *)&remaddr, &addrlen);
if(i==0)
time_start = nano_count();
recvfrom(s, buf, buf_size, 0, (struct sockaddr *)&remaddr, &addrlen);
if(i%10000 == 0){
int64_t time_end = nano_count();
cout<<"number of packets recived and forewarded "<< i <<endl;
Expand Down
4 changes: 2 additions & 2 deletions sendforeward.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ int main(){
int64_t time_start;
int64_t time_end;
for(int i=0;i<num_packets*950;i++){
if(i==0)
time_start = nano_count();
if ( (recvlen = recvfrom(s, buf, buf_size, 0, (struct sockaddr *)&remaddr, &addrlen) > 0)){
if (sendto(s, buf, recvlen, 0, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0){
cout<<"sendto failed"<<endl;
return 0;
}
}
if(i==0)
time_start = nano_count();
if(i%10000 == 0){
time_end = nano_count();
cout<<"number of packets recived and forewarded "<< i <<endl;
Expand Down

0 comments on commit 013bd74

Please sign in to comment.