X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/597f6f31e3801612273886481381df509d8bcd12..a622b081808494796d3679acaebbf5ee364fe9de:/stglibs/pinger.lib/pinger.cpp?ds=sidebyside diff --git a/stglibs/pinger.lib/pinger.cpp b/stglibs/pinger.lib/pinger.cpp index 8e6370ed..af761ffa 100644 --- a/stglibs/pinger.lib/pinger.cpp +++ b/stglibs/pinger.lib/pinger.cpp @@ -98,16 +98,6 @@ if (isRunningRecver) struct timespec ts = {0, 200000000}; nanosleep(&ts, NULL); } - - //after 5 seconds waiting thread still running. now killing it - if (isRunningRecver) - { - if (pthread_kill(recvThread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - } } if (isRunningSender) @@ -121,19 +111,13 @@ if (isRunningSender) struct timespec ts = {0, 200000000}; nanosleep(&ts, NULL); } - - //after 5 seconds waiting thread still running. now killing it - if (isRunningSender) - { - if (pthread_kill(sendThread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - } } close(sendSocket); + +if (isRunningSender || isRunningRecver) + return -1; + return 0; } //-----------------------------------------------------------------------------