diff --git a/foreward b/foreward new file mode 100755 index 0000000..2ad5dd6 Binary files /dev/null and b/foreward differ diff --git a/install.sh b/install.sh index 882da55..91981c2 100755 --- a/install.sh +++ b/install.sh @@ -1,3 +1,4 @@ g++ recive.c -o recive -lrt g++ send.c -o send -lrt -g++ sendforeward.c -o foreward -lrt \ No newline at end of file +g++ sendforeward.c -o foreward -lrt +g++ sendrecive.c -o ping -lrt \ No newline at end of file diff --git a/ping b/ping new file mode 100755 index 0000000..631baed Binary files /dev/null and b/ping differ diff --git a/recive b/recive new file mode 100755 index 0000000..4142e74 Binary files /dev/null and b/recive differ diff --git a/send b/send new file mode 100755 index 0000000..90743cf Binary files /dev/null and b/send differ diff --git a/sendrecive.c b/sendrecive.c new file mode 100644 index 0000000..b116631 --- /dev/null +++ b/sendrecive.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +int64_t nano_count() +{ + struct timespec t; + int ret; + ret = clock_gettime(CLOCK_MONOTONIC,&t); + if(ret != 0) + cout<<"clock_gettime failed"<h_addr_list[0], hp->h_length); + + int64_t time_start; + int64_t time_end; + + for(int i=0;i