If you've read all that is written to a file, aren't you at the end of the file?
sysread returns undef if there's an error. Being at the end of the file is a normal condition, especially for a pipe or socket. You might find some information on sysread by looking at some docs for the underlying read(2) system call, such as this from the docs for it on my system:
RETURN VALUE
On success, the number of bytes read is returned (zero indicates end of file), and the file position is advanced by this number. It is not an error if this number is
smaller than the number of bytes requested; this may happen for example because fewer bytes are actually available right now (maybe because we were close to end-of-file, or
because we are reading from a pipe, or from a terminal), or because read() was interrupted by a signal. On error, -1 is returned, and errno is set appropriately. In this
case it is left unspecified whether the file position (if any) changes.
On what, exactly, are you basing your time at which to read? Are you sure your timer and the timer on the server are set to the exact number of seconds and starting at the same time? If the server hasn't written new data yet, there won't be any new data to read yet.