OK. So I found out why I wasn't getting any data from this!

In sockread, I had the following line which was causing the problem.
Code:
if ($sockbr == 0) return


The output has a blank line before outputting the data!