Added timeout for read on socket