Socket operations with timeouts