add socket connect timeout and recv timeout

Is this required for `select` to work, or is there another reason for it?