I normally use poll() with a timeout rather than take()- prevents blocking forever if things go wrong. YMMV.