Unless I'm mistaken, this is going to consume all of the CPU, since it never sleeps or blocks waiting for a packet to come in (it just keeps checking as fast as possible).  The thing to do would be to have it go to sleep when the queue is empty, and wake it up when something comes in--or just use QThread, since as I mentioned, it handles this case quite handily.