recv loop 'if' -> 'while'