How would I implement a timeout on a thread to prevent a socket from not providing any input
How would I implement a timeout on a thread to prevent a socket from not providing any input
I do not get how timeout could prevent from "not providing" something...
Could you elaborate what are you trying to do?
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
I am running a server which has a thread pool that will take in a client's request on a given socket and then process this request on the socket while the server waits for more connections. But to ensure that a client doesn't connect to one of my threads and doesn't provide the thread with any input so that the just sits there useless I would like to use a timeout to close the socket after a certain period of time if there was no data processing.