Exception handling for socket timeouts