jgauffin / Griffin.Framework

Application framework for Business Applications
http://griffinframework.net
168 stars 63 forks source link

How I can loop for get more messages? #41

Closed tgiachi closed 9 years ago

tgiachi commented 9 years ago

In your example:

[..] if (_bytesLeft == 0) { _stream.Position = 0; var item = _serializer.Deserialize(new StreamReader(_stream), typeof (object)); MessageReceived(item); Clear();

        //TODO: Recursive call to read any more messages
    }

[..]

How I can loop for read more messages?

thank you!

Tochemey commented 9 years ago

Hello there is no need to loop to read more messages. At the decoder level you only decode the current message that has arrived. The job is to properly decode that message and let the decoder ready to handle the next message. Messages will keep coming to decoder as long as the app is running. I hope I have been a bit clear. I faced that problem too until I delved into the code to figure it out and the help of Jonas.

Tochemey commented 9 years ago

I believe you can close this issue.