Maybe you want to set the sockets to nonblocking? Then you can read as much data as there is for the moment.
Also consider looking at the IO (and event) multiplexing frameworks, like AnyEvent, POE and IO::Async. If you prefer to roll your own, IO::Select is a good basis for a start.
In reply to Re: read from socket blocks until buffer is full
by Corion
in thread read from socket blocks until buffer is full
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |