Is there any way to listen to a stream input and perform an action like read() whenever a new byte is available?
Asked
Active
Viewed 68 times
1 Answers
0
By default read() method blocks in open streams till a new input is provided.
You don't need to do any actions.
Read this
If you mean that blocking until new input receives is not desired, create a separate Thread or Fiber to do that for you.
Community
- 1
- 1
Alireza Mohamadi
- 511
- 5
- 19