I'm working with a class that makes a remote connection to a server. A problem that I'm running into is if the connection doesn't get a response, it'll wait until it does.
This class does not have a timeout built into it, and I don't want to modify it if I can avoid it.
Is there any way that I can wrap a section of code in something like this?
try(timeout seconds){
}catch(){
//exception handle
}timeout(){
// timeout handline
}
EDIT: I use the remote connection as one problem. I have others that I need to solve with this as well, like making system calls with exec or other similar things.