Yes, i have only experienced this behaviour on my RaspPi. Even if You have a timeout of 50 ms, it would eventually return only 1-3 bytes and then timeout again. It is obvious, that if You read bytes off the length from HTSP Stream, this HTSP Connections is rendered useless. Moreof, the next read of 4 bytes will read a wrong size. If this wrong size cannot be allocated, it is never checked anywhere. If this can be allocated, it is likely to screw up VM. Anyway, if have experienced the message "Lost Connections to TVHeadEnd" in XBMC quite a few times even on my OSX-XBMC. I believe, that tvheadend is rock solid in serving HTSP, so its always a problem in the frontend.

The TCPSocket routines give no gurantee, that nothing has been read in a case of timeout. So they cannot be used for this purpose as they are right now (finding out if something is available or if it would block). If we wanted it "clean", we had to use the result of the "poll" routine in PVR's read thread rather than try a message read with a delay of 5 ms.