Convert receive loop into Stream

That looks exactly like what I am looking for, thank you so much!