tags:

views:

37

answers:

1

We have message framing working by using a lengh prefix but using .NET 2.0 beginSend/BeginReceive.

Is message framing any different in 3.5, if so how should we implement it using the new framework?

Are there any useable examples out there which focus purely on message framing using 3.5?

Many thanks

+1  A: 

Message framing is an attribute of your application protocol. It doesn't have anything to do with the .NET version you're running on.

I have an example of message framing on my blog, which works for any stream of data in any .NET framework version.

Stephen Cleary
Hi Stephen, just trying to implement your code but i don't understand how this part works: this.MessageArrived(this.dataBuffer); What is MessageArrived and how do i implement that? Do you have a fairly simple example?Many thanks for the help
Rob
If you use the class from my blog post, then assign a handler to `MessageArrived` after construction. Then, as data arrives (e.g., the `BeginRead` callback fires), send the data to `DataReceived`. `DataReceived` will invoke `MessageArrived` once for each message found.
Stephen Cleary