Easily fixed, just change that 0 in your select() call to something larger. The larger you make it the less CPU time your code will take while it waits for something to do. You won't miss any transactions because select() will wake up as soon as there's something to read.
You might also look at IO::Poll - rumor has it that it performs better than select.
-sam