Is there a way to call a function, and then cancel or skip over the call if it takes too long to respond?
I'm simulating an ftp connection, and I'm receiving a response from a server using this function call:
status = receiveMessage(ccSocket, replyMsg, sizeof(replyMsg), &msgSize);
Is there a way to wait, say, 5 seconds, and skip over the function call if it has not yet responded?
Exit() is a core function in the C/C++ programming language that is used to instantly end the calling process (function).
When you click Call the function button, it will execute the function. To stop the function, click Stop the function execution button.
In C++, you can exit a program in these ways: Call the exit function. Call the abort function. Execute a return statement from main .
Many different methods are available for you to solve this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With