There is a method for checking if a stream is empty, check the API.
However, it might be simpler to write a listening class and a sending class and multi-thread each side. Have a look at the examples under Knock Knock.
__________________
--
Man Alone
=======
Abstainer: a weak person who yields to the temptation of denying himself a pleasure.
Ambrose Bierce, The Devil's Dictionary.
|