modified: recv_v to recv_n with timeout