I think this might be missing a `break` or `return` since if there is a header but not a complete packet it might loop forever?