checking if the stream is empty is hugely processor-intensive...itll run every available clock cycle if you give it a chance. using sotimeout throws a special timeout error that you can catch and ignore. writing a listening thread and a sending thread works as well.
|