limit the number of times the receive loop can run without breaking