Original comment bybneukom (Bitbucket: bneukom, GitHub: bneukom):
Mostily fixed this by another WaitFor implementation which uses Regex to wait for specific messages. With this solution we do not heavily rely on awaitReadCompletion but the performance might sometimes be significantly worse.
Originally reported by: bneukom (Bitbucket: bneukom, GitHub: bneukom)
available() method on the stream might return 0 before we get our desired result. We need another way to wait for the result to come