Decomplicated timeout-recv a bit.