I am trying to implement a TCP server which will not hang (potentially) forever during a recv or sendall operation.
I thought it would be enough to specify a timeout for the active socket, but this seems not to be the case: see here
So, how could I extend my code to ensure that:
- recv will not hang up in any case
- sendall will not hang up in any cases (well, I am not sure if sendall can hang up at all)
Any suggestions are highly appreciated.