optional timeout for socket operations